Programming in Prolog
In this class, we are going to use the version of Prolog that is installed on osf1. A sample session is shown below that uses a family fact file and rule file
osf1.gmu.edu> prolog
Quintus Prolog Release 3.5 (Tru64, OSF1 V5.1)
Originally developed by Quintus Corporation, USA.
Copyright (C) 1998, Swedish Institute of Computer Science. All rights reserved.
PO Box 1263, SE-164 29 Kista, Sweden. +46 8 633 1500
Email: qpsupport@sics.se WWW: http://www.sics.se/quintus/
Licensed to George Mason University ITU Enterprise Servers and Operations
| ?- [familydb].
% compiling file /home/u3/cs540/Prolog/familydb
% familydb compiled in module user, 0.016 sec 2,092 bytes
yes
| ?- [familyrules].
% compiling file /home/u3/cs540/Prolog/familyrules
% familyrules compiled in module user, 0.000 sec 632 bytes
yes
| ?- sibling(anne,liz).
no
| ?- sibling(liz,mary).
yes
| ?- cousin(rachel,will).
yes
| ?- sibling(liz,Y).
Y = mary ;
Y = susan ;
Y = virginia ;
no
| ?- grandparent(anne,Y).
Y = will ;
Y = russell ;
Y = rachel ;
Y = maggie ;
Y = emily ;
Y = lucy ;
Y = zelie ;
Y = harry ;
Y = ned ;
Y = patrick ;
no
| ?- grandparent(liz,Y).
no
| ?- cousin(liz,Y).
no
| ?- ^D