Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions