13
OTTER (Organized Techniques for Theorem-proving and Effective Research) Heuristics computing 2014/12/22 9:25 – 11:00 Keio University, SFC

Otter 2014-12-22-01-slideshare

Embed Size (px)

Citation preview

Page 1: Otter 2014-12-22-01-slideshare

OTTER(Organized Techniques for Theorem-proving and

Effective Research)

Heuristics computing 2014/12/22 9:25 – 11:00

Keio University, SFC

Page 2: Otter 2014-12-22-01-slideshare

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" is 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 setB ∩ ¬ A  → empty set

++

+ --

-

Page 3: Otter 2014-12-22-01-slideshare

Syntax “-A | B”: proof by contradiction

AB

C

A ⊃  BB → 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.

Page 4: Otter 2014-12-22-01-slideshare

Liar paradox: Liar, Truth teller and spyintroduce 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)). -Q(n(y)) | P(y).

A  ∩  B  →  empty setB ∨ ¬ A  → not φ

φN(x )【 C】 Spy

Page 5: Otter 2014-12-22-01-slideshare

+

-

Liar and Spy Paradox N(x): power set

+

++

+ + -

--

---

T(x) L(x)

N(x) = T(x) or L(x)

+

-

+++

+ +-

---

--

-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).

1 [] -P(T(x))| -P(Says(x,y))|P(y).2 [] -P(L(x))| -P(Says(x,y))| -P(y).3 [] P(T(x))|P(L(x)).4 [] -P(T(x))| -P(L(x)).5 [] P(Says(A,L(A))).6 [hyper,5,2,3,3] P(T(A)).7 [hyper,5,1,3] P(L(A)).8 [hyper,7,4,6] $F.

Law of Excluded middle

Page 6: Otter 2014-12-22-01-slideshare

Who is SPY ? : consistency and model

【 A】  Always true 【 B】 Always false

【 C】  satisfiable (model) unsatisfiable

A  ∩  B  →  empty setB∪ ¬ A  → not Ф

If system is consistent(not contradictory), there should be a model that satisfies A.

A B

N = A  ∨  B  ∨  not Ф

Page 7: Otter 2014-12-22-01-slideshare

Syntax “A | B” (exclusive, fermi particle model)

AB

C

a

A  ∩  B  →  empty setB∪ ¬ 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

Page 8: Otter 2014-12-22-01-slideshare

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

NP

QIf a system is non-contracition, There should be Q(y) which cannot be inversed or proved

Page 9: Otter 2014-12-22-01-slideshare

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.

Page 10: Otter 2014-12-22-01-slideshare

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))).

Page 11: Otter 2014-12-22-01-slideshare

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

Page 12: Otter 2014-12-22-01-slideshare

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 ...

is a possible step in the multiplication of an integer in which y occurs as a digit by the one-digit integer x; u is the carryover % from the previous step and v is the carryover to the next step. For example, CP(1,5,7,6,3) is true, and represents a step in the multiplication 72 x 95.

Page 13: Otter 2014-12-22-01-slideshare

Alphametic Puzzle list(sos).

-K(u) | -D(x) | -D(y) |

CS(u,x,y,$MOD($SUM($SUM(u,x),y),10),$DIV($SUM($SUM(u,x),y),10)).

-L(u) | -D(x) | -D(y) |

CP(u,x,y,$MOD($SUM(u,$PROD(x,y)),10),$DIV($SUM(u,$PROD(x,y)),10)).

-CP(0,xd,xb,y1,x1) | -CP(x1,xd,xa,y2,y3) |

-CP(0,xc,xb,z1,x2) | -CP(x2,xc,xa,z2,z3) |

-$LT(xa,xc) |

-CS(0,y1,0,xh,x3) | -CS(x3,y2,z1,xg,x4) | -CS(x4,y3,z2,xf,x5) |

-CS(x5,0,z3,xe,0) | S(xa,xb,xc,xd,xe,xf,xg,xh).

end_of_list.