Recursive Rules
- Due:
- 5:00am, Wednesday October 30, 2024
Description
Write a Prolog file named p2.pl
that encodes the following tree:
Then, write recursive rules for the following relations:
ancestor(X,Y)
– true if X is an ancestor of Y.descendant(X,Y)
– true if X is an descendant of Y.sibling(X,Y)
– true if X and Y have the same parent.same_level(X,Y)
– true if X is at the same level in the tree as Y.
Turning in the Assignment
To submit your assignment, create a zip file named p2.zip
of a
DIRECTORY named p2
containing the following files:
p2.pl
Then submit that file to the appropriate folder on D2L.