Logic Programming
Lecture Notes
for
Com Sci 221,
Programming Languages
Last modified: Mon Nov 27 12:28:08 CST 2000
Start Wednesday 22 November 2000
Prolog Examples
I haven't had time to type real notes for this section yet. Here
are some thought-provoking examples of logic programming in
Prolog.
- Symbolic integers
- Unification examples
- Database join
- Equivalence classes as unification structures (incomplete
definitions to be filled in for homework)
- Recursive identity on lists
- Definitions
- The two definitions of identity are logically the same, but
because of the order of conjuncts on the right-hand side, they
behave differently. Find a way to make the second one crash with a
stack overflow, when the first one works. Notice that the behavior
is asymmetric, even though the identity relation is logically
symmetric.