SWI-Prolog has been installed on all linux boxes in 004. You can invoke the Prolog interpreter by giving the command:
pl
at the system prompt. To leave the Prolog interpreter
give the command:
halt.
To load a file of Prolog facts (a database), use the functor consult or simply type the file name in []'s. For example, to load the file likes.pl, type
[likes].
Note the ".pl" extension is not included.
The primary URL is http://www.swi-prolog.org. This site contains a manual as well as various implementations.
There were also a number of good on-line resources:
Solve the following problem with a Prolog program: Mr and Mrs Astor, Mr and Mrs Blake, Mr and Mrs Crane, and Mr and Mrs Davis were seated around a circular table. Mrs Astor was insulted by Mr Blake, who sat next to her on her left. Mr Blake was insulted by Mrs Crane, who sat opposite him across the center of the table. Mrs Crane was insulted by the hostess, who was the only person to sit next to each one of a married couple. The hostess was insulted by the only person to sit next to each one of two men. Who insulted the hostess? (Hint: Mrs. Davis is the hostess.)
This problem is really hard! If you can actually solve it as written above, I will give you 50 pts, but I recommend that you make your life easier and solve the problem using the following additional information for 25 pts.
Above is a seating arrangement that satisfies the problem description. You may assume that you know this information in creating your knowledge base (i.e., prolog program) for this problem. Even though you may treat the seating arrangement as known, you must still determine who insulted the Hostess by writing a clause that finds the only person seated next to each of two men.