Americas
Europe
Q58E
Expert-verifiedSuppose that Prolog facts are used to define the predicates mother and father which represent that M is the mother of Y and F is the father of X, respectively. Give a Prolog rule to define the predicate grandfather , which represents that X is the grandfather of Y. [Hint: You can write a disjunction in Prolog either by using a semicolon to separate predicates or by putting these predicates on separate lines.]
grandfather : - mother , father ; father , father
Prolog facts are used to define the predicates mother and father which represent that M is a mother of Y and F is the father of X respectively.
grandfather : - mother , father ; father ,father
Where, :- means define and , represents a conjunction and ; represent a disjunction.
94% of StudySmarter users get better grades.
Sign up for free