Question: GNU Prolog on PuTTY please. 1. Consider the following diagram of a family tree: Implement the family elationships in a Prolog factbase: 1.0 Enter the

GNU Prolog on PuTTY please.

GNU Prolog on PuTTY please. 1. Consider the following diagram of a

1. Consider the following diagram of a family tree: Implement the family elationships in a Prolog factbase: 1.0 Enter the program using a text editor such as pico or vim under Unix operation system and save the file as family_tree.pl. You may enter the program on your own computer using notepad and upload the program into your ese240prolog directory in general server. Compile the program using the Prolog command: > gple family_tree.pl Enter GNU Prolog programming environment by executing the Unix command gprolog. Execute the program family_ tree by typing GNU Prolog command 13- [family_tree]. To exit from GNU Prolog, type your end-of-file character at the main Prolog prompt ^ (Ctrl-d). l ?- d Ask questions by typing, e.g.: 1?- father_of (mark, beth) . 1?- mother_of (beth, tom) . You can find a complete set of GNU Prolog commands at http://www.gprolog.org/manual/gprolog.html. For all of the following questions, please label the question number in comment. For example, if Question 1.0 asks you to define a rule called is_male (X) that returns "yes" (or "true") if X is the father of a member of the family, then your code should look like: (* Question 1.0/ is_male (X) :- male(X); father_of (X,). Now, you can start to add your code into the program. 1.1 Complete the program by adding facts for the remaining members on the family tree. The section inside of the highlighted box has already been completed for you for clarification. Please pay close attention when adding the remaining famiy members, spelling counts and all letters should be lowercase. 1.2 Define (add into the database) a rule called is female(X) that returns "yes" (or "true") if X is a female or the mother of a member of the family. Note: the system will return a "yes", if it finds a "true" answer and there exist no more true answers. The system will return "true ?" if it finds a "true" answer and there are still possibly further matches. In this case, if you type "enter", it will retum "yes" and stop. If you type ";", it will continue to search for further answers

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!