Logical Representation

PSU CS 441/541 Homework 1
Due before class Thursday, October 18


In this assignment you will model a problem using propositional logic, as defined by Nilsson in chapter 13 of the course text. The notation will be as in the text, except that ASCII syntax will replace the special symbols, as follows

Syntax Operation
not negation
and conjunction
or disjunction
implies implication
iff equivalence
a[b] subscripting (``a sub b'')
If you need more notation, please feel free to define and then use it.


Consider the game of Tic-Tac-Toe. The first thing one learns about this game is that, when it is time to move, there are two kinds of move that are mandatory:

  1. If there is a winning move (an empty square which completes a row, column, or diagonal for the player on move), it should be made.
  2. If there is no winning move, but there is a block (an empty square which is in line with two of the opponent's squares), it should be made.
It can be shown that neither of these heuristics interferes with optimal play. (On the other hand, one can construct an optimal player which does not always follow either of these rules. Can you construct counterexamples for each?)

The above-mentioned rules are classic reactive rules, and the Tic-Tac-Toe board can be directly modeled as a reactive agent in Nilsson's Grid Space World. For uniformity, let us number the squares of the board in the obvious left-to-right, top-to-bottom fashion.

  1|2|3
  -+-+-
  4|5|6
  -+-+-
  7|8|9
One should be able to model board positions using propositional logic, using atoms numbered as shown.


Your assignment is as follows:

  1. Design and implement a production system in the style of Chapter 2 of Nilsson which implements rules 1 and 2 above. Specify what Boolean atoms signify the inputs and actions. Be sure to explain why your system is sound and complete for these rules, in such a way that I can grade it.
  2. Write Boolean formulae whose models are
    1. Complete games of Tic-Tac-Toe which are a win for X.
    2. Complete games of Tic-Tac-Toe which are drawn.
  3. Note that these formulae are likely to be quite large: you may want to generate them semi-automatically. As above, be sure to explain why your formulae are correct, in such a way that I can grade it.
  4. Give an example position where your reactive system does not give an optimal move. Could you design and implement a reactive system which makes an optimal move in any Tic-Tac-Toe position? How about Checkers? Explain.

Homework should be submitted by e-mail to <cs541@cs.pdx.edu>. The words "CS441/541 HW1" should appear somewhere in the subject line. The homework submission should be a writeup in ASCII answering all questions posed by the assignment, in the requested format. More than that, it should answer the spirit of the assignment: try to present the sort of exposition that lets me understand your solution, and the scientific ideas and engineering compromises behind it. Remember, if I can't understand your submission, I can't give you credit for it.

I'd like you to do this assignment by yourself. If you do work with anyone else, you must credit them in your submission.