











































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!












































Logical Rules
Recursion
JoeMenu(b, p) <- Sells(’Joe’’s Bar’, b, p)
Sells(bar, beer, p)
8
The predicate = name of a relation
Arguments are variables (or constants).
Happy(d) <- Frequents(d,bar) AND
Likes(d,beer) AND Sells(bar,beer,p)
10
Distinguished variable
Nondistinguished variables
Interpretation: drinker d is happy if there exist a bar, a beer, and a price p such that d frequents the bar, likes the beer, and the bar sells the beer at price p.
Cheap(beer) <- Sells(bar1,beer,p1) AND
Sells(bar2,beer,p2) AND p1 < 2. AND p2 < 2.00 AND bar1 <> bar