Part 1: Knowledge representation in PROLOG (20 %)

Post date: Oct 08, 2011 9:27:58 PM

I know that you will google for an answer so I step up and post this to gather all class mate to work on it. If you could help just reply.

We are in a marriage bureau with a file of candidates to the marriage containing the following facts: • Paul is tall, brown and of age ripe. He likes classical music, the books of adventure and swimming. His future wife must be tall, with red hair and young.

• Kevin is not very tall, fair and young. He likes rock'n'roll, the books of science fiction and tennis. His future wife should be fair, young and not very tall.

• Doug is small, brown and of age ripe. He likes jazz, the detective novels and tennis. He seeks a small, fair woman of average age.

• Alice is not very tall, fair and of average age. She likes any type of music, the books of adventure and swimming. She seeks a tall man, brown and of average age.

• Eva is not very tall, fair and young. She likes rock'n'roll, books of science fiction, and all sports. She seeks a young man, fair and not very tall.

• Lea is small, brown and of age ripe. She likes classical music, the books of adventure and swimming. She seeks a brown man, not very tall and of age ripe. 1. Using PROLOG, express the facts above in the form of predicates.

2. It is considered that two people X and Y, of different sexes, are matched if : X is appropriate to Y and Y is appropriate to X.X is appropriate to Y if:

• X is appropriate physically to Y (height, color of hair and age of X are those which Y seeks) and,

• X and Y have the same tastes regarding music, literature and sport. Write a PROLOG program determining the matched couples.

Example 1 :

| ?- match(X,Y).

X = kevin Y = eva ? ;

X = eva Y = kevin ? ;

no