This site provides some course material and tools for teaching Logic Programming, Prolog, CLP, and Computational Logic in general, covering both theory and practice. Different parts of this material come from undergraduate and graduate courses taught by us at different institutions, including the Technical University of Madrid (UPM -- CS / AI Dept.), the IMDEA Software Institute, UT Austin (CS Dept.), and the University of New Mexico (CS and ECE Depts).
- See Some Thoughts on How to Teach Prolog (in the book Prolog - The Next 50 Years) and this video, or
- Teaching Pure LP with Prolog and a Fair Search Rule and these slides/Active Logic Document
These courses have been developed and are taught by members of the CLIP group and other contributors. There is much more information available on the CLIP (Computational Logic, Languages, Implementation, and Parallelism) research group and our Computational Logic Software pages. Please note that these pages are all under permanent construction/change. Suggestions, comments, questions, raves, rants, etc., should be directed by email to <clip@cliplab.org>. You are welcome to use all or part of this course material, we only ask you to please quote the origin. We would also very much appreciate if you let us know that you are using it and also that you send us by email to the address above any error corrections or improvements you may make to this material. Thanks in advance.
Teaching tools
- We use the Ciao Prolog system for teaching these courses, since it allows covering within one system pure logic programming, different search rules, Prolog, CLP, analysis, verification, partial evaluation, tabling, etc.; but most of the examples can also be run on any modern system supporting ISO-Prolog, constraint libraries, etc..
-
We also use other tools that we have developed for
teaching Prolog, LP, CLP, etc., including:
- the Prolog Playground (see, e.g., the the LaTeX links to executable code in the pdf slides below), and
-
Active
Logic Documents (ALDs). See, e.g.,
a simple editable example, or
an ALD
version of the "99 Programs in Prolog"
suite, and
its source
code in markdown.
More details can be found in "Teaching Prolog with Active Logic Documents" (in the book "Prolog - The Next 50 Years") and in this poster.
Slides and Examples: The Basic Sequence
Motivational Introduction:
- Introduction and Motivation. [slides w/embedded code] [code] [accessible html]
- Some Textbooks and References.
[pdf]
An open access reference book: The Art of Prolog (Open Access from MIT Press).
Pure Logic Programming
- A "hands-on" Introduction to Logic Programming. [slides w/embedded code] [code] [accessible html]
- Developing Programs with a Logic Programming System [slides] [accessible html]
Prolog
- The (ISO-)Prolog Programming Language. [slides w/embedded code] [code] [accessible html]
- 99 Programs in Prolog [interactive ALD version] [source code in markdown]
Constraint Logic Programming
- Constraint Logic Programming. [pdf] [Code for examples - finite domains.]
Additional Topics
- Some efficiency Issues in Prolog. [pdf]
- Longer slides on Solving Finite Domain Constraints. [pdf]
- An even longer, 5-day seminar on CLP [html].
- Concurrent (Constraint) Logic Programming. [pdf]
LP and CLP Theory
- Automated Deduction Fundamentals. [pdf]
- First Order Logic and Logic Programming Theory. [pdf]
- Same, but just the model and fixpoint semantics. [pdf]
- CLP: operational, model, and fixpoint semantics. [pdf]
Some Ciao Prolog tutorials
- Ciao tutorial at LOPSTR 2018. [pdf] [Download, installation, manuals.]
- Some tutorials on the Ciao Preprocessor, CiaoPP. [html] [Download, installation, manuals.]
- The Ciao Programming System (2000). [pdf] [Download, installation, manuals.]
- The LPdoc Automatic Documenter (2000). [pdf] [Download, installation, manuals.]
- The Ciao Preprocessor, CiaoPP (1999). [pdf] [Download, installation, manuals.]
Other topics
- Global Analysis by Abstract Interpretation. [pdf]
- Abstract Specialization and its Applications. [pdf]
- Parallel Execution of Logic Programs. [pdf]
- Intro to Prolog Implementation:
WAM tutorial, by Hassan Ait-Kaci. [slides] [auth version] [older book website]
Manuel Hermenegildo's original 1989 tutorial. [slides pdf] - Distributed/Internet programming using LP/CLP systems. [pdf]
- WWW programming using LP/CLP systems. [pdf] [Code for examples.]
- A very brief intro to Operational and Axiomatic Semantics [pdf]
General Note: We used to start with basic theory (resolution, etc..), then Logic Programming, then Prolog, CLP(*), and Concurrent LP. Eventually, we decided to start directly with a quick introduction to Logic Programming and Prolog programming, presenting only afterwards theory, CLP, and Concurrent (C)LP. If you prefer to start with theory, just use the lp_theory slides first and skip some slides (first order languages and unification, mainly) from logic_programming.tex.
(One of the reasons for doing things this way is that our students take a semester of formal logic prior to this course and are therefore quite familiar with, e.g., resolution, but not with logic programming. We feel it is best for student motivation to get as quickly as possible to the practical use of the programming tools.)