Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
2Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Prolog Manual

Prolog Manual

Ratings: (0)|Views: 10|Likes:
Published by Tatiana Cotiga

More info:

Categories:Types, School Work
Published by: Tatiana Cotiga on Nov 25, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/07/2011

pdf

text

original

 
Prolog
ProgrammingA First Course
Paul BrnaMarch 5, 2001
 
Abstract
The course for which these notes are designed is intended for undergraduatestudents who have some programming experience and may even have writtena few programs in
Prolog
. They are not assumed to have had any formalcourse in either propositional or predicate logic.At the end of the course, the students should have enough familiarity with
Prolog
to be able to pursue any undergraduate course which makes use of 
Prolog
.This is a rather ambitious undertaking for a course of only twelve lecturesso the lectures are supplemented with exercises and small practical projectswherever possible.The
Prolog
implementation used is SICStus Prolog which is closely mod-elled on Quintus Prolog (SICS is the Swedish Institute of Computer Science).The reference manual should also be available for consultation [SICStus, 1988].c
Paul Brna 1988
 
Contents
1 Introduction 1
1.1 Declarative vs Procedural Programming . . . . . . . . . . . . 11.2 What Kind of Logic? . . . . . . . . . . . . . . . . . . . . . . . 11.3 A Warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 A Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Knowledge Representation 3
2.1 Propositional Calculus . . . . . . . . . . . . . . . . . . . . . . 32.2 First Order Predicate Calculus . . . . . . . . . . . . . . . . . 42.3 We Turn to
Prolog
. . . . . . . . . . . . . . . . . . . . . . . 52.4
Prolog
Constants . . . . . . . . . . . . . . . . . . . . . . . . 72.5 Goals and Clauses . . . . . . . . . . . . . . . . . . . . . . . . 82.6 Multiple Clauses . . . . . . . . . . . . . . . . . . . . . . . . . 82.7 Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.8 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.9 The Logical Variable . . . . . . . . . . . . . . . . . . . . . . . 112.10 Rules and Conjunctions . . . . . . . . . . . . . . . . . . . . . 122.11 Rules and Disjunctions . . . . . . . . . . . . . . . . . . . . . . 132.12 Both Disjunctions and Conjunctions . . . . . . . . . . . . . . 142.13 What You Should Be Able To Do . . . . . . . . . . . . . . . . 15
3 Prologs Search Strategy 16
3.1 Queries and Disjunctions . . . . . . . . . . . . . . . . . . . . 163.2 A Simple Conjunction . . . . . . . . . . . . . . . . . . . . . . 193.3 Conjunctions and Disjunctions . . . . . . . . . . . . . . . . . 213.4 What You Should Be Able To Do . . . . . . . . . . . . . . . . 23
4 Unication, Recursion and Lists 26
4.1 Unication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.3 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.4 What You Should Be Able To Do . . . . . . . . . . . . . . . . 32i

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->