
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

You can often tell what the language designers thought about their language by the libraries that are included with it. Many of Prolog’s involve the analysis of structres. In this lecture we will go over some of the builtin predicates of Prolog.
1 ?- dynamic likes/2. 2 ?- likes(john,mary). 3 No 4 ?- assert(likes(X,Y) :- likes(Y,X)). 5 ?- assert(likes(john,mary)). 6 ?- likes(mary,X). 7 ERROR: Out of local stack 8 ?- retract(likes(john,mary)). 9 Yes 10 ?- asserta(likes(john,mary)). 11 Yes 12 ?- likes(mary,X). 13 X = john
Try the following problems. In a few minutes the instructor will go over the solutions. Feel free to work with the person next to you!
1 ?- says(frank,likes(john,mary)). 2 ?- likes(john, mary). 3 Yes 4 ?- disbelieve(frank). 5 ?- likes(john, mary). 6 No
Mattox Beckman Page 1 Illinois Institute of Technology