2. Liar and truth-teller paradox:
problem is contradictory
the liar paradox or liar's paradox (pseudomenon in Ancient Greek) is
the statement "this sentence is false." Trying to assign to this
statement a classical binary truth value leads to a contradiction.
If "this sentence is false" is true, then the sentence is false,
which is a contradiction. Conversely, if "this sentence is false"
s false, then the sentence is true, which is also a contradiction.
%assign(max_proofs,-1).
set(hyper_res).
set(print_lists_at_end).
assign(stats_level,0).
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(T(x)) | -P(L(x)).
end_of_list.
list(sos).
P(Says(A, L(A))).
end_of_list.
【 A 】 Always true 【 B 】 Always false
A ∩ B → empty set
B ∩ ¬ A → empty set
+
+
+ -
-
-
3. Syntax “-A | B”: proof by contradiction
A
B
C
A ⊃ B
B → A
There exists Ai where
B∪ ¬ A → Ф
1 [] -Greek(x)|Person(x).
2 [] -Person(x)|Mortal(x).
3 [] Greek(socrates).
4 [] -Mortal(socrates).
5 [hyper,3,1] Person(socrates).
6 [hyper,5,2] Mortal(socrates).
7 [binary,6.1,4.1] $F.
3 |list(usable).
4 | -Greek(x) | Person(x).
5 | -Person(x) | Mortal(x).
6 |end_of_list.
8 |list(sos).
9 | Greek(socrates).
10 |end_of_list.
12 |list(passive).
13 | -Mortal(socrates).
14 |end_of_list.
4. Liar paradox: Liar, Truth teller and spy
introduce XOR and power set
On a fictional island, all inhabitants are either knights, who always tell the
truth, or knaves, who always lie. In some variations, inhabitants may also
be alternators, who alternate between lying and telling the truth, or
normals, who can say whatever they want (as in the case of
Knight/Knave/Spy puzzles).
+
+
+ -
-
-
【 B 】 Always false
+ - ++
-
【 A 】 Always true
-P(T(x)) | -P(Says(x,y)) | P(y).
-P(L(x)) | -P(Says(x,y)) | Q(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(n(T(x))) | P(L(x)) | P(N(x)).
-P(n(L(x))) | P(T(x)) | P(N(x)).
A ∩ B → empty set
B ∨ ¬ A → not φ
φN(x )
【 C 】 Spy
6. Who is SPY ? : consistency and model
【 A 】 Always true 【 B 】 Always false
【 C 】 satisfiable (model) unsatisfiable
A ∩ B → empty
set
B∪ ¬ A → not Ф
If system is consistent
(not contradictory),
there should be a
model
A B
N = A ∨ B ∨ not Ф
7. Syntax “A | B”
(exclusive, fermi particle model)
AB
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
8. N (power set) = P(x) Q(x) ?∨ ∨
P Q
list(usable).
-P(T(x)) | -P(Says(x,y)) | P(y).
-P(L(x)) | -P(Says(x,y)) | Q(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(n(T(x))) | P(L(x)) | P(N(x)).
-P(n(L(x))) | P(T(x)) | P(N(x)).
-Q(n(y)) | P(y).
end_of_list.
list(sos).
P(Says(A,n(L(B)))).
P(Says(B,n(T(A)))).
end_of_list.
N
-Q(n(y)) | P(y). : 排中律
Law of excluded middle
N
P
Q
If a system is non-contracition,
There should be Q(y) which cannot
be inversed or proved
9. Russel’s barber paradox
The barber paradox is a puzzle derived from Russell's
paradox. It was used by Bertrand Russell himself as an
illustration of the paradox, though he attributes it to an
unnamed person who suggested it to him. It shows that
an apparently plausible scenario is logically impossible.
Specifically, it describes a barber who is defined such that
he both shaves himself and does not shave himself.
In Prolog, one aspect of the barber paradox can be expressed by a self-referencing
clause:
shaves(barber, X) :- male(X), not shaves(X,X).
male(barber).
where negation as failure is assumed. If we apply the stratification test known
from Datalog, the predicate shaves is exposed as unstratifiable
since it is defined recursively over its negation.
list(usable).
-P(T(x)) | -P(Says(x,y)) | P(y).
-P(L(x)) | -P(Says(x,y)) | Q(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(n(T(x))) | P(L(x)) | P(N(x)).
-P(n(L(x))) | P(T(x)) | P(N(x)).
-Q(n(y)) | P(y).
end_of_list.
10. The Twelve-Coins Puzzle
■ You have 12 coins. All coins appears to be identical. But you are told that one
of them is a counterfeit (lighter or heavier than other genuine coins).
■ You can use an scale or scales which is an equal-arm balance. The balance
provides one of three possible indications: the right pan is heavier, or the pans
are in balance, or the left pan is heavier. The balance has sensitivity sufficient
for the task.
■ One objective is to identify the counterfeit coin, and to check whether it is
heavy or light.
■This time the balance may be used three times to determine if there is a
unique coin—and if there is, to isolate it and determine its weight relative to the
others.
achievable(state(hls(12),hs(0),ls(0),s(0),rem(3))).
-solvable(state(hls(12),hs(0),ls(0),s(0),rem(3))).
11. Clause representation:
deterministic or underterministic
IF A THEN B : -A | B
IF A & B THEN B : -A | -B | C
IF A THEN B or C : -A | B | C
achievable(state(hls(12),hs(0),ls(0),s(0),rem(3))).
-solvable(state(hls(12),hs(0),ls(0),s(0),rem(3))).
a b
a b c
a b
c
12. Alphametic Puzzle
BA
C D
y1y2y3
z1z2z3
gfe h
We wish to find all 8-tuples (a,b,c,d,e,f,g,h)
of distinct digits such that the product is
valid. For example, since 72 x 95 = 6840,
(7,2,9,5,6,8,4,0) is one such 8-tuple.
It is
understood that a, c, and e are non-zero.
We use the predicate CP(u,x,y,z,v) to
express that
... y ...
x
___________
... z ...