Hints on Prolog

SWI Prolog is the default prolog on the IT and the Grad suns. A simple prolog example is in the file parent. In this example the file name is parent and not parent.pl to avoid problems with Netscape. The command to consult the file would have been the same even if the file had the .pl extension. Here is a sample run.
dante> pl
Welcome to SWI-Prolog (Version 4.0.0)
Copyright (c) 1990-2000 University of Amsterdam. 
Copy policy: GPL-2 (see www.gnu.org)

For help, use ?- help(Topic). or ?- apropos(Word).

1 ?- [parent].
% parent compiled 0.01 sec, 1,792 bytes

Yes
2 ?- grandparent(X,Y).

X = john
Y = bill ;

X = john
Y = dan ;

No
3 ?- grandparent(john,X).

X = bill ;

X = dan ;

No
4 ?- parent(X,Y).

X = sonja
Y = mary ;

X = sonja
Y = jane ;

X = john
Y = jim ;

X = john
Y = bob ;

X = bob
Y = bill ;

X = bob
Y = dan ;

No
5 ?- listing.

mother(sonja, mary).
mother(sonja, jane).

father(john, jim).
father(john, bob).
father(bob, bill).
father(bob, dan).

parent(A, B) :-
	mother(A, B).
parent(A, B) :-
	father(A, B).

grandparent(A, B) :-
	parent(A, C),
	parent(C, B).

Yes
6 ?- halt.
dante>