3. Example 2: Truth tellers, liars and spy
On the fabled Island of Knights and Knaves, we meet three people, A, B, and C, one of whom
is a knight, one a knave, and one a spy. The knight always tells the truth, the knave always
lies, and the spy can either lie or tell the truth.
A says: "C is a knave."
B says: "A is a knight."
C says: "I am the spy."
Who is the knight, who the knave,
and who the spy?
set(hyper_res).
list(usable).
-P(T(x)) | -P(Says(x,y)) | P(y).
-P(L(x)) | -P(Says(x,y)) | -P(y).
P(T(x)) | P(L(x)) | P(N(x)).
-P(T(x)) | -P(L(x)).
-P(T(x)) | -P(N(x)).
-P(L(x)) | -P(N(x)).
-P(T(x)) | P(L(x)) | P(N(x)).
-P(L(x)) | P(T(x)) | P(N(x)).
end_of_list.
list(sos).
P(Says(A,L(C))).
P(Says(B,T(A))).
P(Says(C,N(C))).
end_of_list.
Always true (恒
真)
Always false(恒
偽)
Satisfiable(証明可能) Unsatisfiable(証明不可
能)
私は正直者だと言っているスパイ
私は嘘つきだと言っているスパイ
https://github.com/RuoAndo/otter-book/tree/master/takefuji-lab/2017
4. Proof and satisfiability
A
B C
a
A ∩ B → empty set
B∪¬A → not Ф
b
c
fermi particle model bose particle model
X
Y
Z
X
Y
Z
a
ab
c
c
a
X(a) | Y(b)
either, exclusive
electron, proton
X(a) or Y(b)
inclusive
photon
Always true Always false
satisfiable
unsatisfiable
unsatisfiable
satisfiable
5. Generalization: consistency is non-deterministic
(∃y) (x) ~ Dem (x, y) ⊃ (x) ~ Dem(x, sub(n, A, n))
Dem(x,y) : yの言っていることをxが確かめる。
Island is consistent if there are only truth tellers and liars.
島に正直者と嘘つきしかいない場合、確かめる事のできない言明がある。
その言明とは、「私は嘘好きである」というものである。
(∃y) (x) ~ Dem (x, y)
Dem(x, sub(n,A,n)): 自分について言っていること(sub(n,A,n)をxが確かめることができる。
If the island is consistent, no one in the island know if there are some spy.
「私は嘘つきである」という言明を確かめることができない場合、誰も島にスパイがいることを発見できない。
しかし、OTTERは発見できる。
7. Paramodulation
1 |set(para_into).
2 |assign(stats_level,1).
3 |
4 |list(usable).
5 | father(ken)=jim.
6 | mother(jim)=fay.
7 |end_of_list.
8 |
9 |list(sos).
10 | Grandmother(mother(father(x)),x).
11 |end_of_list.
Grandmother
Fay
Jim
Ken
Jim
father
mother
SoS List:
list(list)
Usable List:
list(usable)
8. • Condition 1: For all a and x, b exists
where Parity(b, x) == Parity(a, x)
• Condition 2: For all b and x, a exists
where Parity(a,x) != Parity(b,x)
Result: For all x,
H exists Parity (x[i], H) != Parity (x[j], H)
Curious property of parity
9. Example 4: Two-inverter puzzle
A
B
C
-A
-B
-C
The 2-NOTs problem: Synthesize a black box which computes NOT-
A, NOT-B, and NOT-C from A, B, and C, using an arbitrary number
of ANDs and ORs, but only 2 NOTs.
NOT
AND
AND
AND
AND
AND
AND
AND
AND
AND
AND
OR
OR
OR
OR
OR
OR
OR
OR
NOT
11. Primitive recursive function
• The basic primitive recursive functions are given by
these axioms:
• Constant function: The 0-ary constant function 0 is
primitive recursive. => AND
• Successor function: The 1-ary successor function S,
which returns the successor of its argument (see Peano
postulates), is primitive recursive. That is, S(k) = k + 1. =>
OR
• Projection function: For every n≥1 and each i with 1≤i≤n,
the n-ary projection function Pi
n, which returns its i-th
argument, is primitive recursive. => NOT*NOT
13. Usable Set+
+
++
+
-
-
lightest
+
-
EMPTY
Usable Set
SoS Set
SoS Set
--
prg2-4.out.lined
-----> EMPTY CLAUSE at 0.00 sec
--> 8 [hyper,7,4,6] $F.
Size of Usable set (nonliear)
Main Loop
A
B
C
C ⊃ B
B ⊃ A
There exists
A[i] where
B∪¬A → Ф
(empty)
A’
14. Clause Sets and representation
SoS
(Set of Support)
Demodulators
Usable
Passive
Term
Rewriting
Resolution
and paramodulation
conflict
a b
a b c
a b
c
IF A THEN B : -A | B
IF A & B THEN B : -A | -B | C
IF A THEN B or C : -A | B | C
15. Strategies
Restriction Strategies
Set of Support
Weighting
Direction Strategies
Ratio
Resonance
Look-ahead Strategies
Hot List
Redundancy control
Subsumption
DemodulationParamodulation
Dynamic Hot List
Subtautology
Resonance restriction
Level SaturationRecursive Tail
Hints
First-in Last-out
Proof checking filter
http://www.mcs.anl.gov/research/projects/AR/strategies.html
Set of Support