Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Logic Programming A little bit of Prolog
 

Summary: 1
Logic Programming
1
A little bit of Prolog
Objects and relations between objects
Facts and rules. Upper case are variables.
parent(pam bob) parent(tom bob)parent(pam, bob). parent(tom,bob).
parent(tom, liz). parent(bob, ann).
parent(bob, pat). parent(pat, jim).
? parent(bob, pat).
? parent(bob, liz).
? parent(bob, ben).
? parent(bob X)
We use parent(We use parent(x,yx,y) to mean x is a parent of y.) to mean x is a parent of y.
But to the computer it is just a relation, whichBut to the computer it is just a relation, which
could mean:could mean:
y is a parent of xy is a parent of x
2
? parent(bob, X).
? parent(X, Y).

  

Source: Allan, Vicki H. - Department of Computer Science, Utah State University

 

Collections: Computer Technologies and Information Sciences