Logical Representation

PSU CS 441/541 Homework 1
Due before class Monday, October 9

In this assignment you will represent a problem instance in first-order logic, as defined by Ginsberg in chapters 6-8 of the 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'')
forall universal quantification
exists existential quantification
If you need more notation to describe the instance, please feel free to define and then use it.

The problem instance is the Zebra Problem, defined below. The subscript notation defined above is to help with the locational data: you may also use simple arithmetic ("+" and "-") in subscripts. You may also quantify over indices as needed.

For each of the 14 English sentences in the instance description, write a set of logical sentences which are equivalent. For example, sentence 5 might be rendered as

    forall i . green(House[i]) iff ivory(House[i-1])
or as
    (green(House2) and ivory(House1)) or
    (green(House3) and ivory(House2)) or
    (green(House4) and ivory(House3)) or
    (green(House5) and ivory(House4))
You may need to start with some general sentences about the problem statement.


Homework should be submitted by e-mail to <bart@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 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.


The Zebra Problem

The infamous Zebra Problem concerns five houses, each of a different colour and inhabited by men of different nationalities, with different pets, drinks and cigarettes.

  1. The Englishman lives in the red house.
  2. The Spaniard owns a dog.
  3. Coffee is drunk in the green house.
  4. The Ukrainian drinks tea.
  5. The green house is directly to the right of the ivory house.
  6. The Old-Gold smoker owns snails.
  7. Kools are being smoked in the yellow house.
  8. Milk is drunk in the middle house.
  9. The Norwegian lives in the first house on the left.
  10. The Chesterfield smoker lives next to the fox owner.
  11. Kools are smoked in the house next to the house where the horse is kept.
  12. The Lucky-Strike smoker drinks orange juice.
  13. The Japanese smokes Parliament.
  14. The Norwegian lives next to the blue house.
The questions to be answered from these facts are
  1. Who (which nationality) drinks water?
  2. Who owns the zebra?

Thanks to René Stolp <rst@cs.tu-berlin.de> for his class web page http://www.epita.fr/~n-da_y/backjumping1.html which gives roughly the above statement of the problem.