next up previous contents
Next: Saving a file Up: Running a Prolog program Previous: Netscape   Contents

An Example

Use the Programmer's File Editor to create a file called family.pl. Launch the program and create a new file window from the File menu.

When you have created a new file window, type the following, being particularly careful to type exactly what appears here, including full stops and commas:

male(harry).
female(liz).

parent(phil, chas).
parent(liz, chas).
parent(chas,harry).
parent(chas,wills).

grandmother(GM, C):-
    mother(GM, P),
    parent(P, C).

mother(M,C):-
    female(M),
    parent(M, C).



Subsections

Steve Harlow 2001-11-12