Homework X

 

 

1. [10 points]

Problem 1, p. 192 of our text.

 

2. [[10 points]

Problem 9, p. 193 of our text.

 

3. [20 points]

Examine the database in the file kennedy.pl in our class directory. Consult this file and enter a query

(a) that succeeds (repeatedly) for each person born in a given year (e.g, 1961)

(b) that succeeds (repeatedly) for each child of a given individual (e.g., patricia_Kennedy)

 

4. [15 points]

Examine the database in the file familial.pl in our class directory. Consult this file and the kennedy.pl file, and formulate a query

(a) using the brotherOf predicate that succeeds (repeatedly) for each individual for whom john_Kennedy is their brother

(b) using the brotherOf and parentOf predicates that succeeds (repeatedly) for each person who is an uncle of edward_KennedyJr

 

Your solutions for problems 3 & 4 should be a computer printout of Prolog runs that show your queries and their results. These results can be obtained using the 'script' command which places a copy of all the information displayed on your screen into a designated file -- then you just print that file. You can read the documentation for this command with 'man script', but it is straightforward. Just enter 'script filename' to start the recording, and enter command 'exit' to terminate recording when you are finished.