This preview shows page 1. Sign up to view the full content.
Unformatted text preview: female(X) /* X is female */ diff(X,Y) /* X and Y are different */ Write Prolog clauses to dene the following relationships: is_mother(X) /* X is a mother */ is_father(X) /* X is a father */ is_son(X) /* X is a son */ sister_of(X,Y) /* X is a sister of Y */ grandpa_of(X,Y) /* X is a grandfather of Y */ grandma_of(X,Y) /* X is a grandmother of Y */ sibling(X,Y) /* X is a sibling of Y */ aunt(X,Y) /* X is an aunt of Y */ For example, we could write a rule for aunt, provided that we were supplied with (or wrote) rules for female, sibling, and parent: aunt(X,Y) : female(X), sibling(X,Z), parent(Z,Y). Reference: Clocksin W.F. and C.S. Mellish. Programming in Prolog (Fourth Edition) . Berlin: SpringerVerlag, 1994. 1...
View
Full
Document
This note was uploaded on 06/11/2011 for the course CSCE 330 taught by Professor Valtorta during the Spring '10 term at Columbia SC.
 Spring '10
 Valtorta

Click to edit the document details