next up previous contents
Next: Unit 3: Prolog: queries Up: Unit 2: Prolog: facts Previous: Unit 2: Prolog: facts

 

Responses

The result of this into Prolog and then querying the database with the query mother(X,Y). is:

dee /home/gibbon/Prolog: sicstus
SICStus 3  #3: Tue Dec 17 15:08:48 MET 1996
| ?- assertz(mother(sue,john)).

yes
| ?- assertz(mother(sue,anne)).

yes
| ?- mother(X,Y).

X = sue,
Y = john ? ;

X = sue,
Y = anne ? ;

no
| ?-



Dafydd Gibbon
Thu Feb 12 11:04:00 MET 1998