Introduction to
Logic Programming
What
versus
How
 

Exercise 3.1 - Syntax


For each of the following strings, say whether it is a syntactically legal expression in our query language.

(a) goal(X) :- p(a,f(f(X)))
(b) goal(X,Y) :- p(X,Y) & ~p(Y,X)
(c) ~goal(X,Y) :- p(X,Y) & p(Y,X)
(d) goal(P,Y) :- P(a,Y)
(e) goal(X) :- p(X,b) & p(X,p(b,c))