Syllabus of Logic Programming in Prolog
Goals
The goal of this course is to give an overview of a new programming
paradigm: programming by means of logic (also known as logic
programming). The language to illustrate it is Prolog. The simplicity
of first-order inference makes it a good candidate to explore this
field. The similarities between Prolog programming and querying
databases inductively, e.g., by means of Datalog, are mentioned. The
course is complemented by notes on the larger field of artificial
intelligence (AI), in particular abstract neural networks and their
application to pattern recognition and clustering.
How to achieve the goals
The complete slide presentation is already available at the author's web site, so
students should read some slides in advance before attending the
corresponding class. This way, they also can get a clear meaning of
the language --- since this course is taught in English. Exercises
will be given during class in order to assess student's understanding
and for training purposes. Two quizzes will be formally given
too. Each time, the answers will be available from the author's web
site in a short delay.
Textbook
Many textbooks are available in English and Korean but this course
will be founded upon regular programming homeworks instead of
reading.
Topics
-
- Foreword, personal presentation to the students, presentation
of the course topics, the didactic objectives, the
textbook.
- Explanation of the teaching method and that the slides are
already available from the author's web site.
- Programming in logic with Prolog
- A deductive database
- Relations and facts (example of a family tree)
-
- Clauses and instances
- Substitution of variables
- What is a ground query? An open query? A conjunctive
query?
- Goals, subgoals and predicates
-
- Binary relations
- Inverse relation
- Rule, head and body
- More on instantiation
-
- Querying the family tree again
- Exercises
- First quiz
-
- Recursive rules
- First glimpse of the resolution algorithm
- Backtracking
- Examples with basic logical connectors
-
- The proof tree as a trace of answer to a query
- Inference rules
- Examples
- Mid-term examination
-
- Objects, atoms, constants, variables
- Notion of lexical scoping
- Structures and functors
- Prolog terms as trees
-
- Exercises
- Matching in more details
- Closed and open terms
- Variable binding (revisiting substitution and
instantiation)
- Examples from geometry
- Second quiz
-
- Declarative and procedural meaning of a Prolog program
(or: truth and finding the truth)
- Resolution algorithm in details
- Examples
-
- Tuples and their tree representation
- Lists
- Lack of static typing in Prolog
- Arithmetic operators and their interaction with
backtracking
- Numerical comparisons versus matching
-
-
- The Eight Queens Problem solved in details
- Final examination