Otter 2016-11-28-01-ss

Post on 09-Jan-2017

23 views 0 download

Transcript of Otter 2016-11-28-01-ss

OTTER(Organized Techniques

for Theorem-proving and Effective Research)

Heuristics computing 2016/11/28 9:25 – 11:00

Keio University, SFC

Puzzles#apt-get install otter git#git clone https://github.com/RuoAndo/otter-book

https://sites.google.com/site/ottershujinopeji/

Sites

Prolog(1972)

C(1973)

LISP(1953)

1950 200019801970 1990 2010

JAVA(1995)

Ocaml(2004)

ML(1973)

Type InferenceIsabelle(1986)

OTTER(1996)

Haskell(1986)

gcc(1985)

Google MapReduce(2004)

scala(2003)

Coq(1984) Proverif(2003)

Python(1991)

SQL86(1986)

Shift-Reduce

Imperative

Imperative

Associatron

Proof Assistant

Higher order

Automated reasoning

Hybridlamda

Unification

Compiler

Database

Hybrid

???

Mainframe Object orientedProgramming Data mining BigData(AI2)

Four main streams of computing paradigmAlgorithm(A1)

PopField(1982)

Boltzman Machine(1985)

BackProp(1986)

SOM(1981) SVM(1991) Deep Learning(2012)

A

D

C

B

Thermodynamics

Proof Assistant Kernel

Autoencoder

Boosting(2004)

OTTER background algorithm device language

Turing machine Turing tape ComputerRecursive function Kleene Loop C language

lambda calculus Church recursion HaskellNatural deduction Gentzen Mathematical

recursion Proof

Proof Theory

Hilbert System

Gentzen System

Sequent calculus

Tableau Calculus

Resolution Principle

OTTER is resolution style theorem prover.

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)

StrategiesRestriction Strategies

Set of Support

Weighting

Direction Strategies

Ratio

Resonance

Look-ahead Strategies

Hot List

Redundancy control

Subsumption

Demodulation

Paramodulation

Dynamic Hot List

Subtautology

Resonance restriction

Level SaturationRecursive Tail

Hints

First-in Last-outProof checking filter

http://www.mcs.anl.gov/research/projects/AR/strategies.html

15 puzzle

set(para_into).

list(usable).EQUAL(l(hole,l(n(x),y)),l(n(x),l(hole,y))).EQUAL(l(hole,l(x,l(y,l(z,l(u,l(n(w),v)))))),l(n(w), l(x,l(y,l(z,l(u,l(hole,v))))))).

-STATE(l(n(1),l(n(2),l(n(3),l(n(4),l(end,l(n(5), l(n(6),l(n(7),l(n(8),l(end,l(n(9),l(n(10),l(n(11), l(n(12),l(end,l(n(13),l(n(14),l(n(15), l(hole,end)))))))))))))))))))).end_of_list.

list(sos).STATE(l(n(1),l(n(6),l(n(2),l(n(4),l(end,l(n(5), l(hole,l(n(3),l(n(8),l(end,l(n(9),l(n(10),l(n(7), l(n(11),l(end,l(n(13),l(n(14),l(n(15), l(n(12),end)))))))))))))))))))).end_of_list.

Complexity of 15 puzzle

1 6 2 45  3 89 10 7 11

13 14 15 12

Prg4-8.in : SCORE 437

1 6 2 45 3  89 10 7 11

13 14 15 12

Prg4-8-7.in : SCORE 891

11 2 6 94 14 3 51 12 7 15

13 10 6 Prg4-8-2.in : SCORE ????

https://github.com/RuoAndo/otter-book/tree/master/15puzzle# cd otter-book# git pull

Paramodulation Usable List: list(usable)

SoS List: list(list)

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

FayJim

Ken

Jim

father

mother SoS List: list(list)

Usable List: list(usable)

• Condition 1: For all a and x, b exists where Parity(b, x) == Parity(a, x)

• Condition 2: For all b and x, a existswhere Parity(a,x) != Parity(b,x)

Result: For all x, H exists Parity (x[i], H) != Parity (x[j], H)

Curious property of parity

Calculus ratiocinator byLeibnitz (1646 - 1716)

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

OROR

OR

OR

OR

ORNOT

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

Backup Slides 1

+

-

-

-

fx

Resolution

yg

xh

f

y

clash

clash

Set of Support : list(sos)

Usable List : list(usable)

Horn Clause -A | -B | -C | D

Weight = 10

Weight = 7

Clash (resolve.c)225 |static void clash(struct clash_nd *c_start,226 | struct context *nuc_subst,227 | struct literal *nuc_lits,228 | struct clause *nuc,229 | struct context *giv_subst,230 | struct literal *giv_lits,231 | struct clause *giv_sat,232 | int (*sat_proc)(struct clause *c),233 | int inf_clock,234 | int nuc_pos,235 | int ur_box) # global -t clash

clash resolve.c 225

Main loop of OTTER image3 (Empty Set)A⊃B implies B → A There exists Ai whereB∪¬ A → Ф

+

-

-

-

fx

Main-loop and strategies

yg

xh

f

y

clash

clash

Set of Support : list(sos)

Usable List : list(usable)

Horn Clause -A | -B | -C | D

Weight = 10

Weight = 7

Redundancy control

Redundancy control

Weighting

Set of Support

Resonance

Clause representationIF A THEN B : -A | B

IF A & B THEN B : -A | -B | C

IF A THEN B or C : -A | B | C

a b

a b c

a b

c

Liar and truth-teller paradox: problem is contradictorythe 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

++

+ --

-

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.

Liar paradox: Liar, Truth teller and spyintroduce XOR and power setOn 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

+

-

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

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 Ф

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

AB

C

a

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

bc

fermi particle model bose particle model

X

Y

Z

X

Y

Z

a

abc

ca

X(a) | Y(b) either, exclusive

electron, proton

X(a) or Y(b) inclusive

photon

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