Introduction

The following resources are copyright James Powers 1997

Lab is due on Wednesday 12/2 (after Thanksgiving).

0. Getting Started

5 ?- [user].
|: eats(john,shrimp).
|: eats(mary,haddock).
|: <ctrl-d>

Now work through Tutorial 0

1. Facts and Rules

Rules take the following form:

friends(X,Y) :- likes(X,Z), likes(Y,Z).

This says that two people are friends if they share a common thing that they like, or literally: “prolog should conclude that X and Y are friends if there’s something (Z) that both X and Y like”

Here’s another example of a rule:

% mother(C,M) is true if C has a mother named M
mother(C,M) :- parent(C,M), female(M).

Now work through Tutorial 1

2. Some Arithmetic

Now work through Tutorial 2

After working through this section, complete the exercises at the bottom of the page.

Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement