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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started