Question: PROLOG PROGRAM: -------------------------------------------------------------------- Given the following set of Prolog clauses father(X,Y):-parent(X,Y),male(X). parent(sally,bob). parent(jim,bob). parent(alice,jane). parent(thomas,jane). male(bob). male(jim). male(thomas). female(sally). female(alice). -------------------------------------------------------------------- (1) how many atoms
PROLOG PROGRAM:
--------------------------------------------------------------------
Given the following set of Prolog clauses"
father(X,Y):-parent(X,Y),male(X).
parent(sally,bob). parent(jim,bob). parent(alice,jane). parent(thomas,jane).
male(bob). male(jim). male(thomas).
female(sally). female(alice).
--------------------------------------------------------------------
(1) how many atoms are matched to the variable X before the following query reports a result:
?-father(X,jane).
--------------------------------------------------------------------
(2) How many different facts are given in this Prolog program?
--------------------------------------------------------------------
(3)What will the variable X be bound with when the query ?-father(X,jane). reports a result?
--------------------------------------------------------------------
(4) How many different rules are given in this Prolog program?
--------------------------------------------------------------------
(5) How many different variables are used in this Prolog program?
--------------------------------------------------------------------
(6) How many different atoms are specifid in this prolog program?
--------------------------------------------------------------------
(7) Add a rule that states parent bill had only sons (no daughters) and every such son became a parent of a child named frank, walkter, or george.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
