Programming Assignment 2 - Introduction to Artificial Intelligence | CS 440, Assignments of Computer Science

Material Type: Assignment; Class: Introduction to Artificial Intelligence; Subject: Computer Science; University: Colorado State University; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 03/11/2009

koofers-user-ypx-1
koofers-user-ypx-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS440: Introduction to Artificial Intelligence
Fall 2008
Programming Assignment #2: Predicate Clue Kibitzer
Due Tuesday, Nov. 4th, at noon.
Introduction
In the second writing assignment, you described a propositional calculus “clue kibitzer” that
could watch a game of clue and determine if any of the players had cheated. To make kibitzing a
propositional problem, we simplified the game a little, by asserting that no player ever made an
accusation that they knew to be false, and by removing the notion of which player denied an
accusation. For the programming assignment, you will implement a clue kibitzer based on
resolution theorem proving. However, we will add these two elements back into the game,
requiring predicate (rather than just propositional) theorem proving.
The Challenge
As in the writing assignment, your program is to listen to a game of clue and determine after
every move whether anyone has cheated. This time, however, the game is a little more realistic.
When a player makes an assertion in the form of a suspect, weapon and room (e.g. “I suspect
Prof. Plum with the knife in the kitchen”), they make the assertion to a specific player, and the
response comes from that player. Hence the response tells you whether a specific player can
disprove the assertion, not whether any player can disprove it. Also, it is possible that the player
making the assertion could disprove it, were they to ask themselves. Also, the number of players
per game is not fixed; any number can play, and different instance of the game will have different
numbers of players.
The specification is as follows: write a program that takes two arguments: an input file and an
output file. The input file contains the assertions made during a game (in the format described
below). Your program will write the output file (as described below). You must also write a
documentation file that describes (1) exactly how to compile your program and (2) exactly how to
run your program. You should submit a tar file through the class Checkin script containing your
source code (including Makefiles, if necessary) and your documentation, but no compiled code.
Failure to follow this (simple) specification will result in points being deducted.
Input
The input file contains one line of ASCII text per move of the game. Each line has six elements
separated by white space. The six elements are: player number (asking), who, with what, where,
player number (responding), and true/false. For example, the first line of an input file might look
like:
1 Plum Knife Conservatory 3 false
This would indicate that player 1 asserted that it was Prof. Plum with the Knife in the
Conservatory, and player 3 disproved it.
pf2

Partial preview of the text

Download Programming Assignment 2 - Introduction to Artificial Intelligence | CS 440 and more Assignments Computer Science in PDF only on Docsity!

CS440: Introduction to Artificial Intelligence

Fall 2008

Programming Assignment #2: Predicate Clue Kibitzer

Due Tuesday, Nov. 4

th

, at noon.

Introduction

In the second writing assignment, you described a propositional calculus “clue kibitzer” that could watch a game of clue and determine if any of the players had cheated. To make kibitzing a propositional problem, we simplified the game a little, by asserting that no player ever made an accusation that they knew to be false, and by removing the notion of which player denied an accusation. For the programming assignment, you will implement a clue kibitzer based on resolution theorem proving. However, we will add these two elements back into the game, requiring predicate (rather than just propositional) theorem proving.

The Challenge

As in the writing assignment, your program is to listen to a game of clue and determine after every move whether anyone has cheated. This time, however, the game is a little more realistic. When a player makes an assertion in the form of a suspect, weapon and room (e.g. “I suspect Prof. Plum with the knife in the kitchen”), they make the assertion to a specific player, and the response comes from that player. Hence the response tells you whether a specific player can disprove the assertion, not whether any player can disprove it. Also, it is possible that the player making the assertion could disprove it, were they to ask themselves. Also, the number of players per game is not fixed; any number can play, and different instance of the game will have different numbers of players.

The specification is as follows: write a program that takes two arguments: an input file and an output file. The input file contains the assertions made during a game (in the format described below). Your program will write the output file (as described below). You must also write a documentation file that describes (1) exactly how to compile your program and (2) exactly how to run your program. You should submit a tar file through the class Checkin script containing your source code (including Makefiles, if necessary) and your documentation, but no compiled code. Failure to follow this (simple) specification will result in points being deducted.

Input

The input file contains one line of ASCII text per move of the game. Each line has six elements separated by white space. The six elements are: player number (asking), who, with what, where, player number (responding), and true/false. For example, the first line of an input file might look like:

1 Plum Knife Conservatory 3 false

This would indicate that player 1 asserted that it was Prof. Plum with the Knife in the Conservatory, and player 3 disproved it.

Output

Your output file must contain exactly the same number of lines as the input file. Each line should contain one word: either OK or Cheat. If no cheating has been detected after the Nth move, then the Nth line of the output file should contain the word OK. If cheating has been detected, the Nth line should contain the word Cheat.

Late Policy

Assignments are due when they are due; late assignments are not accepted. There is a departmental exception for “unforeseeable circumstances”. Examples include medical emergencies, family tragedies, fires, etc. If such an unforeseeable circumstance happens to you, please talk to the instructor. We will work with you on a case-by-case basis.

Hints

  1. I strongly recommend using players as the domain of discourse, and suspects, weapons and rooms as predicates. The semantics I recommend are that Plum(x) means that player x has the Plum card (and therefore Plum didn’t do it), while ¬Plum(x) means only that player x doesn’t have the Plum card.
  2. If you take hint #1, you might want to add truth (or equivalently the envelope) as a fictitious player. This is because truth holds three cards, namely the person, weapon and room who actually did do it. (Note, however, that this fictitious player will never appear in the input file.)
  3. Suggestions 1 & 2 imply initial axioms of the following form: ∃x Plum(x) interpretation: somebody has the Plum card (possibly truth) ∀x,y Plum(x) ^ Plum(y) ⇒ (x = y) only one player can have the Plum card
  4. Refuted assertions add statements of the form: (Plum(3) v Knife(3) v Conservatory(3)) where three is one of the players
  5. Non-refuted assertions add statements of the form: (¬Plum(3) ^ ¬Knife(3) ^ ¬Conservatory(3)) where three is again a player
  6. Write a predicate resolution theorem prover to determine if cheating has occurred.

As always….

All work must be your own. You may not copy code from the internet, your colleagues or anyone else.