• :00Days
  • :00Hours
  • :00Mins
  • 00Seconds
A new era for learning is coming soonSign up for free
Log In Start studying!

Select your language

Suggested languages for you:
Answers without the blur. Sign up and see all textbooks for free! Illustration

Q58E

Expert-verified
Discrete Mathematics and its Applications
Found in: Page 56
Discrete Mathematics and its Applications

Discrete Mathematics and its Applications

Book edition 7th
Author(s) Kenneth H. Rosen
Pages 808 pages
ISBN 9780073383095

Answers without the blur.

Just sign up for free and you're in.

Illustration

Short Answer

Suppose that Prolog facts are used to define the predicates mother (M,Y) and father (F, X)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 (X,Y), 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 (X,Y): - mother (M,Y), father X,M; father F,Y, father X,F

See the step by step solution

Step by Step Solution

Step 1: Given information

Prolog facts are used to define the predicates mother M,Yand father F,X which represent that M is a mother of Y and F is the father of X respectively.

Step 2: Prolog rule to define the predicate sibling(X,Y)

grandfather (X,Y): - mother M,Y, father X,M; father F,Y,father X,FX,F

Where, :- means define and , represents a conjunction and ; represent a disjunction.

Most popular questions for Math Textbooks

Icon

Want to see more solutions like these?

Sign up for free to discover our expert answers
Get Started - It’s free

Recommended explanations on Math Textbooks

94% of StudySmarter users get better grades.

Sign up for free
94% of StudySmarter users get better grades.