Question: Write and test a Prolog program q2.pl that solves the following puzzle: The police are trying to track down the gang of three kids who

Write and test a Prolog program q2.pl that solves the following puzzle: The police are trying to track down the gang of three kids who have been stealing pumpkins. So far, they have established the following facts: the kids first names are Angela, Mary, and David; one is 5, one is 7, and one is 8; one has the last name Diamond, and the one with the last name Grant is 3 years older than the one with the last name Leung. You can assume Angela and Mary are female and David is male. Use the technique shown in the zebra example discussed in class (the code is available on the course web page) to find missing information on the gang: each childs age, gender, first name and last name, consistent with the data above. (Encode the above data as is and do not add additional facts.) Use your Prolog code to show whether or not the computed information uniquely identifies the culprits; submit these test results in the file q2tests.txt, together with the program file. Document your code appropriately.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!