Turn in through Oncourse Assignments.
To start and stop SWI Prolog on merlin:
$ pl Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.7.11) Copyright (c) 1990-2009 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- halt.
(On some other systems, the command to start SWI Prolog is
To start and stop GNU Prolog on merlin:
$ gprolog GNU Prolog 1.3.1 By Daniel Diaz Copyright (C) 1999-2009 Daniel Diaz | ?- halt.
To capture your session in a file:
Using a text editor, create a Prolog knowledge base that represents the following information:
Barry is a brown mouse. Greta is a gray mouse. Mabel is a mouse, too.
Carl, Cathy, Hector, and Juana are cats. Carl sees everything that's brown or gray. Cathy sees everything that's brown. Hector and Juana see all mice. Hector is gray, and Juana is brown. Juana is lame.
Mutt is a brown dog.
Any cat that sees a mouse will chase the mouse, unless the cat is lame.
The first three sentences (about the mice) express five facts.
Use two rules for what Carl sees.
All statements (facts or rules) defining a predicate should be grouped together.
Save and turn in your Prolog source file.
Use Prolog to query your knowledge base. Capture the session as a plain text file and turn it in. Find all solutions (use
; if needed) for each question.
Use common sense to check the answers given by Prolog, and adjust your queries and/or knowledge base if needed.
Turn in your source code file(s) and saved testing session(s) (plain text files(s) with extension .txt) as attachments in Oncourse Assignments.
Total: 40 points