Assignment 1
Solution

CPSC 322

Fall 1997

Question 1

Given the knowledge base:
a <- b & c.
a <- e & f.
b <- d.
b <- f & h.
c <- e.
d <- h.
e.
f <- g.
g <- c.
  1. [3 marks] Give a model of the model of the knowledge base.

    The minimal model has {a,c,e,f,g} true and {b,d,h} false.

    Another model is where all atoms are true.

  2. [3 marks] Give an interpretation that is not a model of the knowedge base.

    The interpretation with a false, and all other atoms true isn't a model as the first clause is false in this interpretation.

    The interpretation with all atoms false isn't a model as the 7th clause is false in this interpretation.

  3. [2 marks] Give two atoms that are logical consequences of the KB.

    Any two of {a,c,e,f,g}.

  4. [2 marks] Give two atoms that are not logical consequences of the KB.

    Any two of {b,d,h}.

Question 2

The file

~cs322/cilog/elect_bug.cil
is an axiomatization of the electrical wiring domain (Figure 3.1, page 69, of the text), but it contains a buggy rule. The aim of this exercise is to use CILog to automatically find the buggy rule, namely the rule that is false in the intended interpretation given in Figure 3.1, given the denotation of the symbols as on page 70 of the text. To find the buggy rule, you won't even need to look at the source code! All you need to know is the meaning of the symbols in the program, and what is true in the intended interpretation.

The following is a trace showing how to run CILog on this example:

CILOG Version 0.11. Copyright 1997, David Poole.
CILOG comes with absolutely no warranty.
All inputs end with a period. Type "help." for help.
cilog: load 'elect_bug.cil'.
CILOG theory elect_bug.cil loaded.
cilog: ask lit(L).
Answer: lit(l1).
  [ok,more,how,help]: how.
   lit(l1) <-
      1: light(l1)
      2: ok(l1)
      3: live(l1)
   How? [Number,up,retry,ok,prompt,help]: how 3.
   live(l1) <-
      1: connectedto(l1, w0)
      2: live(w0)
   How? [Number,up,retry,ok,prompt,help]: how 2.
   live(w0) <-
      1: connectedto(w0, w1)
      2: live(w1)
   How? [Number,up,retry,ok,prompt,help]: how 2.
   live(w1) <-
      1: connectedto(w1, w5)
      2: live(w5)
   How? [Number,up,retry,ok,prompt,help]: how 1.
   connectedto(w1, w5) <-
      1: ok(cb2)
   How? [Number,up,retry,ok,prompt,help]: ok.
Answer: lit(l1).
  [ok,more,how,help]: ok.
cilog: 

The following is the clause found to be wrong (false in the intended interpretation).

   connectedto(w1, w5) <-
      1: ok(cb2)