Question: . Implement the following in GNU Prolog console: Suppose that we have two Prolog rules: tower(Top, Bottom) :- on(Top, Middle), on(Middle, Bottom). tower(Top, Bottom) :-
. Implement the following in GNU Prolog console:
Suppose that we have two Prolog rules:
tower(Top, Bottom) :- on(Top, Middle), on(Middle, Bottom).
tower(Top, Bottom) :- on(Top, Middle), tower(Middle, Bottom).
and four Prolog facts:
on(a, b).
on(b, c).
on(c, d).
on(d, e).
What answers will the query tower(Any, e) return? Remember that Prolog treats words beginning with an upper-case letter as variables and ones beginning with lower case as constants
- Does the following Prolog query succeed? If not, explain why not. If so, what bindings will be reported?
?- believes(X, likes(mary, pizza)) = believes(frank, likes(Y, pizza)).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
