Question: Write your programs using logical language Prolog. Use SWISH (SWI Prolog for Sharing). Run each of your programs by typing a query and clicking on

Write your programs using logical language Prolog. Use SWISH (SWI Prolog for Sharing). Run each of your programs by typing a query and clicking on Run button. Please attach input and outputs. Please closely follow all the instructions!

1) Consider a hypothetical family tree from the file FamilyTree.

Create a simple database containing facts and inference rules. Include facts about family members, such as male, female, parent. Then add rules such as sister, brother, sibling, father, mother, grandparent. Run queries that will answer the following questions about family members: (a) Is Pete Marks parent? (b) Is Anne Jennys parent? (c) Who is Todds father? (d) Who is Toms sibling? (e) Who is Lillys brother? (f) Who is Henrys grandparent? (g) Who is Alices sister? (h) Is Frank Kates brother? (i) Who is Matts mother? (j) Is Mark Annes brother?

Submission file should include your database and snippets of the results of all queries.

2) Write a Prolog program that finds the maximum of a list of numbers. The submission file should include a screenshot with tracing a program execution when a list only has 2 members and execution without tracing when a list has 8 elements.

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!