Upload
ruo-ando
View
27
Download
0
Embed Size (px)
Citation preview
OTTER(Organized Techniques
for Theorem-proving and Effective Research)
Heuristics computing 2016/11/14 9:25 – 11:00
Keio University, SFC
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 paradigm
Algorithm(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)
Four Languages on Turing machine
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 Applied to computation
OTTER is resolution style theorem prover.
Imperative ( 命令型)
Declarative (関数型)
compiler
Interpreter(scripting)
Lamda calculator
Prover
C, C++ Java
Pythonruby
perl
Haskell
Ocaml
Prolog
Isabelle
scala
proverif
Involves Assembly
Intermediate representationNOT Assembly
Immutable variables
Resolution, SAT computation-< x { -< y { x.call(y) } }
OTTER
LOOP and FLAG
LIST and DECLARATION
Boost Template
Two streams of computing paradigm: Imperative vs Declarative (language classification)
flag
methodstate
function
function
Puzzles#apt-get install otter git#git clone https://github.com/RuoAndo/otter-book
https://sites.google.com/site/ottershujinopeji/
Sites
Liar paradox: 正直者と嘘つきの島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.
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
Main loop of OTTER image1
+-
++
++
--
+
+++
-
+ - ++
+
+ -
clash
+-+
clash
+-
pick up pick up
Search stopped because sos
empty.
Rules (usable)
Set of support (facts)
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)
Hyper resolution: atom electron model
+
-++
+
+- +
++
++
+
1 |set(hyper_res).2 |assign(stats_level,1).3 |4 |list(usable).5 | -Sibling(x,y) | Brother(x,y) |
Sister(x,y).6 |end_of_list.7 |8 |list(sos).9 | Sibling(pat, ray) | Cousin(pat, ray).10 |end_of_list.
clash
Set of Support
Pick up
Set of Support
++
yielded state(clause sets)
Hyperresolution focuses on two or more clauses, requiring that one of the clauses (the nucleus) contain at least one negative literal and the remaining (the satellites) contain no negative literals.
proof and satisfiability
Always true Always false
satisfiable
unsatisfiable
unsatisfiablesatisfiable
AB
C
A ∩ B → empty setB∪ ¬ A → not Ф
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.
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
Main loop of OTTER clause.c 3384 |struct clause *extract_given_clause(void) 3385 |{ 3386 | struct clause *giv_cl; 3387 | 3388 | CLOCK_START(PICK_GIVEN_TIME); 3389 | giv_cl = find_given_clause(); 3390 | if (giv_cl) { 3391 | rem_from_list(giv_cl); 3392 | } 3393 | CLOCK_STOP(PICK_GIVEN_TIME); 3394 | return(giv_cl); 3395 |} /* extract_given_clause */
3334 |struct clause *find_given_clause(void) 3335 |{ 3336 | struct clause *giv_cl; 3343 | if (Flags[SOS_QUEUE].val) 3344 | giv_cl = find_first_cl(Sos); 3345 | 3346 | else if (Flags[SOS_STACK].val) 3347 | giv_cl = find_last_cl(Sos); 3348 | 3368 | else 3369 | giv_cl = find_lightest_cl(Sos); 3370 | }
There are three kinds of searching state space
1) Stack 2) Queue
3) weghting
If there is no clause found inset of support,
reasoning process is terminated.
OTTER’s basic methodology
resolution
modulation
Binary resolutionModus potens, one by one
Hyper resolutionNucleus and satellite, All at one
DemoulationTerm rewriting
ParamodulationEquational reasoning
list(usable). (a=b) | (c=d).end_of_list.list(sos). P(a) | Q(n, f(c,g(d))).end_of_list.
list(usable). -Greek(x) | Person(x). -Person(x) | Mortal(x). end_of_list.list(sos). Greek(sorates). end_of_list.
list(usable). -A(x,y) | A(x, S(y)).end_of_list.list(demodulators). S(S(x)) = x.end_of_list.
|list(usable). -Sibling(x,y) | Brother(x,y) | Sister(x,y).end_of_list.list(sos). Sibling(pat, ray) | Cousin(pat, ray).end_of_list.
Clause Sets (節集合構成)
SoS (Set of Support)
Demodulators
Usable
Passive
Term rewriting
Resolution
Detect
Four interactions and OTTER
+
+ +-
-
+Gravitational interaction(weighting)weight_list(pick_and_purge).weight(P(rew($(0),$(0)),$(1)), 99)
Electromagnetic interaction (resolution)-father(x,y) | -mother(x,z) | grandmother(x,z)
Strong / weak interaction (modulation)(a=b) | (c=d).P(a) | Q(n, f(c,g(d))).
+
+
15 puzzleThe 15-puzzle (also called Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and many others) is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing.The n-puzzle is a classical problem for modelling algorithms involving heuristics.
http://mathworld.wolfram.com/15Puzzle.html
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.
Play the Fifteen puzzle onlinehttp://migo.sixbit.org/puzzles/fifteen/
paramodulation
paramodulation
1 |set(para_into).4 |assign(stats_level,1).5 |6 |list(usable).7 | a1 = b1.8 | a2 = b2.9 |end_of_list.10 |11 |list(sos).12 | P(a1,a2).13 |end_of_list.
Clauses are generated according to line 7 and 8.
Paramodulation1 |set(para_into).2 |assign(max_given,3).3 |assign(stats_level,1).4 |5 |list(usable).6 | (a=b) | (c=d).7 |end_of_list.8 |9 |list(sos).10 | P(a) | Q(n, f(c,g(d))).11 |end_of_list.
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.