Download presentation
Presentation is loading. Please wait.
Published byBrian Lloyd Modified over 9 years ago
1
Automated Theorem Proving Presentation by Kenny Pearce CSE 391: Artificial Intelligence April 22, 2005
2
The State of the Art ● OTTER – “Organized Techniques for Theorem- Proving and Effective Research” – Proves theorems in first order logic with equality using resolution-based techniques – Written in C for Unix – Developed at Argonne National Lab – http://www-unix.mcs.anl.gov/AR/otter/
3
Resolution Russel and Norvig 7.5 ● Consider this problem (to which we will return later): – Axiom Set: {(L&W), (L->(~F))} – Theorem: (~F) ● Standard Proof: – (L&W) ⊧ L (& Elimination) – {(L->(~F)), L} ⊧ (~F) (Modus Ponens) – QED
4
Resolution Proof: First, Translate into Conjunctive Normal Form, with Theorem Negated: (L&W&(~L|~F)&F) Resolution Russel and Norvig 7.5 Consider this problem (to which we will return later): Axiom Set: {(L&W), (L->(~F))} Theorem: (~F) X X (L&W&~F&F) Yields an empty clause, therefore argument valid
5
OTTER Successes ● Found a shorter single axiom for lattice theory ● Found several shorter single axioms for ternary boolean algebra ● Proved that all Robbins algebras are boolean ● Found a shorter axiom system for two-value sentential calculus ● More at http://www- unix.mcs.anl.gov/AR/new_results/
6
Is OTTER an AI Theorem Prover? ● Uses Resolution ● Guided by Heuristics ● BUT relative weights of heuristics, restrictions, etc. must be customized by a human for each problem ● The human has to have a good idea of what kinds of proof techniques will be useful on this problem; OTTER can't figure that out on its own.
7
My Approach: A Computer That Does Logic Like a Human ● Resolution is not the most effective proof procedure for humans. It is easy to do, but is time consuming. ● Instead, humans use truth trees or derivation systems ● These proof systems are better for humans because we are good at deciding which of several possible next steps will be most useful; an AI with a sufficiently powerful heuristic should perform better with one of these systems for the same reason humans do. ● My program implements a subset of the derivation system found in The Logic Book by Merrie Bergmann, James Moor, and Jack Nelson
8
Bergmann et al.'s Sentential Derivation System (SD) ● SD Rules: – Reiteration (P ⊧ P) – Introduction and Elimination Rules for Each Operator ● Rules I Implemented: – Those not requiring sub-derivations, namely: ● & Elimination ● ~ Elimination ● & Introduction ● Modus Ponens (-> and Elimination) ● -> Introduction ● Introduction ● | Introduction ● Elimination
9
Implementation Details: The Sentence Class (Sentence.py) class Sentence: def __init__(self, rep=None, sent1=None, op=None, sent2=None): if op == None: self.op = None self.sent1 = None self.sent2 = None self.rep = rep elif op == "&" or op == "|" or op == "->" or op == " ": self.op = op self.sent1 = sent1 self.sent2 = sent2 self.rep = None elif op == "~": self.op = op self.sent1 = sent1 self.sent2 = None self.rep = None else: raise Sentence.OpException()
10
Implementation Details: The Sentence Class (Sentence.py) def negate(self): """Returns the negation of this sentence""" return newComplexSentence(self, "~") def conjoin(self, other): """Returns the conjunction of this Sentence with the Sentence other""" return newComplexSentence(self, "&", other) def disjoin(self, other): """Returns the disjunction of this Sentence with the Sentence other""" return newComplexSentence(self, "|", other) def cond(self, other): """Returns the Sentence "self -> other".""" return newComplexSentence(self, "->", other) def bicond(self, other): """Returns the Sentence "self other".""" return newComplexSentence(self, " ", other)
11
Implementation Details: The Proof Class (Proof.py) class Proof(Problem): def path_cost(self, c, state1, action, state2): addCost = 1 if state2[len(state2)-1].complexity() > self.goal.complexity(): addCost = addCost + (state2[len(state2)-1].complexity() - \ self.goal.complexity()) * 2 S = state2[len(state2)-1].atoms() dups = 0 for s in S: dups = dups + S.count(s) - 1 if s not in self.goal.atoms(): addCost = addCost + 1 addCost = addCost + dups if action.find("Intro") != -1: addCost = addCost + 3 for op in self.goal.ops(): if(action.startswith(op)): if(addCost > 1): addCost = addCost - 1 else: addCost = 1 return addCost + c
12
Implementation Details: The Proof Class (Proof.py) def goal_test(self, state): return (self.goal in state or self.goal.negate() in state) def missing_pieces(self, thm, state): """Helper function that counts the number of subcomponents of thm not in state. For use in recursive calls (see component_h below)""" if(thm in state): return 0 if(thm.sent1 == None and thm.sent2 == None): return 1 count = 1 if(thm.sent1 != None): count = count + self.missing_pieces(thm.sent1, state) if(thm.sent2 != None): count = count + self.missing_pieces(thm.sent2, state) return count def component_h(self, n): """A heuristic that counts the number of subcomponents of the goal theorem which are not in the state""" val = self.missing_pieces(self.goal, n.state) return val
13
Implementation Details: Defining a Problem p2.py from Proof import * Ax1 = Sentence("L").conjoin(Sentence("W")) Ax2 = Sentence("L").cond(Sentence("F").negate()) thm = Sentence("F").negate() p2 = Proof((Ax1,Ax2), thm) Console >>> from p2 import * >>> p2.initial ((L & W), (L -> ~F)) >>> p2.goal ~F
14
Does It Work? ● Yes! ● Problems Solved: P1 (A* Only) Axioms: {(P&C), (T&M), (E&(I&R))} Theorem: ((P&T)&R) Solution: (P&C), (T&M), (E&(I&R)), P, T, (I&R), R, (P&T), ((P&T)&R) P2 (The one we looked at earlier) Solution: (L&W), (L->~F), L, ~F P3 Axioms: {(K (~E&Q)), K} Theorem: Q Solution: (K (~E & Q)), K, (~E&Q), Q P4 (A* Only) Axioms: {(P->(S (A&B))), (P&S)} Theorem: B Solution: (P->(S (A&B))), (P&S), S, P, (S (A&B)), (A&B), B
15
Does It Work? ● Yes! ● Problems Solved: P5 (A* Only) Axioms: {(S&(S->E)), (C E), (C G)} Theorem: G Solution: (S&(S->E)), (C E), (C G), S, (S->E), E, C, G P6 (A* Only) Axioms: {((A&(B&C))&D), ((B&C)->E))} Theorem: E Solution: ((A&(B&C))&D), ((B&C)->E), (A&(B&C)), (B&C), E P7 Axioms: {A, C, (C->D)} Theorem: (A&D) Solution: A, C, (C->D), D, (A&D)
16
Efficiency Comparison Searcher P2 P3 P7 breadth_first_graph_search iterative_deepening_search astar_search ● P2 – Axioms: {(L&W), (L->~F)} – Theorem: ~F ● P3 – Axioms: {(K (~E&Q)), K} – Theorem: Q ● P7 – Axioms: {A, C, (C->D)} – Theorem: (A&D) ● Format:
17
Conclusions: Automated Theorem Proving ● Computers are good at it! ● But not as good as people... ● Resolution works best right now ● But with better heuristics other methods may overtake it ● Having more rules requires fewer steps, but more code and more memory, and there's more opportunity for the prover to go down the wrong track. ● Even with only very simple heuristics, a computer can solve all the logic problems on your 260 homework. Hmm...
18
Bibliography ● Argonne National Laboratory. “Automated Reasoning at Argonne”. [Cited 21 April 2005]. Available Online (http://www-unix.mcs.anl.gov/AR/). ● Bergmann, Merrie, James Moor, and Jack Nelson. 1998. The Logic Book. New York: McGraw-Hill. ● Boyer, Robert S. and J. Strother Moore. July 1990. “A Theorem Prover for a Computational Logic”. Keynote Address, 10 th Conference on Automated Deduction. Available Online (http://www.cs.utexas.edu/users/boyer/cade90.pdf). ● McCune, William. 2003. OTTER 3.3 Reference Manual. Argonne, IL: Argonne National Laboratory. Available Online (http://www- unix.mcs.anl.gov/AR/otter/otter33.pdf). ● Norton, L. M., 1971. Experiments with a heuristic theorem proving program for the predicate calculus with equality. Artificial Intelligence 2:261-284. ● Russell, Stuart and Peter Norvig. 2003. Artificial Intelligence: A Modern Aproach. Upper Saddle River, New Jersey: Pearson Education, Inc.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.