Up Previous Next Title Page Contents

1.4. 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).

Up Previous Next Title Page Contents