oct 8
homework
- 7.5
- Four propositions: (A,B,C,D), so total number of models is 2**4 = 16
- Count number of rows in truth table of those 16 where each of these is true.
- (A and B) or (B and C) : 6
- (A or B) : 12, i.e. 3 for AB as TT|TF|FT times 4 for DC combos
- A iff B iff C : 4
$ cd /var/www/cs/htdocs/courses/fall2007/ai/code/AIMA_lisp/code
$ clisp -M aima
> (validity "Smoke => Smoke")
VALID
> (validity "Smoke => Fire")
SATISFIABLE
> (validity "(Smoke => Fire) => (~Smoke => ~Fire)")
SATISFIABLE
> (validity "Smoke | Fire | ~Fire")
VALID
> (validity "((Smoke ^ Heat) => Fire) <=> ((Smoke => Fire) | (Heat => Fire))")
VALID
> (validity "(Smoke => Fire) => ((Smoke ^ Heat) => Fire)")
VALID
> (validity "Big | Dump | (Big => Dumb)")
VALID
> (validity "(Big ^ Dumb) | ~Dumb")
SATISFIABLE
7.11
- Assertion that there are two mines adjacent to cell 1,1?
In the 3x3 block around cell 1,1
there are (choose 8 2) pairs of neighbors = 8*7/2 = 28 pairs.
For each of these pairs you write a sentance that says that
these two are true and the others are false. For example
to say that there are bombs in 2,2 and 1,2, you'd write
x[2,2] ^ x[1,2] ^ ~x[0,2] ^ ~x[0,1] ^ ~x[2,1] ^ ~x[0,0] ^ ~x[1,0] ^ ~x[2,0]
The whole thing has 27 more lines like this, with "or" between
each of the lines.
- Same idea but a different number of positive and negatives in each line. There will be (choose n k) lines if n neighbors contain k bombs.
- For each of the cells that have been examined, construct the sentences described above and add them to the knowledge base. Then see what can be concluded about the cell you're interested in.
- Using the same argument as above, to say "In these 100 cells there are 20 mines" would take (choose 100 20) lines, each with 100 terms, which is about 10**39 ... way too big. Instead, if we're searching with an algorithm that assigns values to symbols, we have it explicitly fail if the model we're looking at violates the number of known mines.
- No specific conclusions are invalid, no.
- If the board is |-|1|-|1|-|1|-|1|-| then looking at the left unknown - determines what's going on at the far right.
class discussion
- 7.9 Is the unicorn mythical?
; Problem 7.9 in the text
; $ clisp -M aima ...
(setf kb (make-prop-kb))
(tell kb "Mythical => Immortal")
(tell kb "~Mythical => (~Immortal ^ Mammal)")
(tell kb "(Immortal | Mammal) => Horned")
(tell kb "Horned => Magical")
(format t "Mythical ? ~A ~%" (ask kb "Mythical"))
(format t "not Mythical ? ~A ~%" (ask kb "~Mythical"))
(format t "Magical ? ~A ~%" (ask kb "Magical"))
(format t "Horned ? ~A ~%" (ask kb "Horned"))
Can you do this using resolution? Forward or backward chaining?
coming
- opencyc
- lewis carroll's Symbolic Logic
- circuit agents
- advanced (but standard) algorithms discussed in text: walksat etc.