Prolog

Examples

Look at the file examples.pl.

Exercises

  1. Construct a Prolog genealogy database that covers 3 generations of your family. You may use the following facts in your database: male(x), female(x), and parent(x, y) where x is the parent of y.
  2. Define a function that counts the number of top level elements in a Prolog list.