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

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!