CSI 2165, Winter 2006

 

Assignment 1

Due Monday, Feb 6, 11am

 

 

Submission instructions: The submission is done electronically through Virtual Campus.

Please submit a file called a1.pl with comments inside. The first comment should include your name and student number. The file should contain the Prolog code for the required predicates, and comments explaining what they do and how they do it. Add in comments example queries that you ran for testing each predicate and what the Prolog output was (thorough testing is important). Make sure your program can be loaded (consulted) in Prolog without giving errors. Make sure the name of the file and the names of the predicates are the required ones. 

Note: No late assignments are allowed.

 

 

The Prolog application that you are going to implement is about solving the following murder mystery:

 

jean was killed on tuesday; the only suspects are:

 

           luc,  paul,  alain,  bernard,  and louis.

 

The rules to follow are:

 

 

      Here are the facts established by the investigation:

 

      luc has an alibi for tuesday given by bernard

      paul has an  alibi for tuesday given by bernard

      louis has an alibi for tuesday given by luc

      alain has an alibi for thursday given by luc

      alain is not a trustworthy person

      paul wants to take revenge on jean

      luc wants to take revenge on jean

      bernard is the beneficiary of jean’s fortune

      jean is the beneficiary of  louis’s fortune

      louis owns money to jean

      luc owns money to jean

      jean has seen alain committing a crime

      luc owns a gun

      louis owns a gun

      alain owns a gun

 

 

1.     Implement the above facts and rules for describing the problem.

(You choose the names of these predicates.)

 

2.     Have Prolog solve the murder mystery, by using the facts and the rules to answer the question:

who killed jean? 

The predicate that solves the mistery should be called solve, with one argument (solve/1), the name of the murderer.  This predicate passes the necessary arguments to your predicates from part 1. (namely the victim, jean and the day, tuesday).

 

 

Have fun!!!