Artificial Intelligence 9. Resolution Theorem Proving

Slides:



Advertisements
Similar presentations
Applying Machine Learning to Automatic Theorem Proving The Nature of the Research The aim of my research is to use machine learning techniques to detect.
Advertisements

Artificial Intelligence 8. The Resolution Method
Some Prolog Prolog is a logic programming language
Inference Rules Universal Instantiation Existential Generalization
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Knowledge Representation and Reasoning University "Politehnica" of Bucharest Department of Computer Science Fall 2010 Adina Magda Florea
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Logic Use mathematical deduction to derive new knowledge.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Inference and Resolution for Problem Solving
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
The HOMER System for Discovery in Number Theory Simon Colton Imperial College, London.
C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester Prepared by: amani Omer.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Model Checking and Theorem Proving slides by Gulay Unel.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Automated Theory Formation: First Steps in Bioinformatics Simon Colton Computational Bioinformatics Laboratory.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Introduction to Proofs
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
1 Chapter 8 Inference and Resolution for Problem Solving.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
The HR Program for Theorem Generation Simon Colton Mathematical Reasoning Group University of Edinburgh.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 17 Wednesday, 01 October.
The AI War LISP and Prolog Basic Concepts of Logic Programming
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 23 Friday, 17 October.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 18 of 41 Friday, 01 October.
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
Programming Languages Third Edition Chapter 4 Logic Programming.
DEDUCTION PRINCIPLES AND STRATEGIES FOR SEMANTIC WEB Chain resolution and its fuzzyfication Dr. Hashim Habiballa University of Ostrava.
Automated Theorem Discovery Simon Colton Universities of Edinburgh and York.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Resolution Theorem Proving in Predicate Calculus Lecture No 10 By Zahid Anwar.
Calculation Invention and Deduction Dr. Simon Colton Imperial College London (Formerly at Edinburgh) YVR in Karlsruhe & Saarbrucken.
Some Thoughts to Consider 5 Take a look at some of the sophisticated toys being offered in stores, in catalogs, or in Sunday newspaper ads. Which ones.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
CS 416 Artificial Intelligence Lecture 13 First-Order Logic Chapter 9 Lecture 13 First-Order Logic Chapter 9.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Resolution in the Propositional Calculus
Logical Inference: Through Proof to Truth
Lecture 2 Propositional Logic
CS 416 Artificial Intelligence
Logic Use mathematical deduction to derive new knowledge.
Biointelligence Lab School of Computer Sci. & Eng.
Biointelligence Lab School of Computer Sci. & Eng.
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

Artificial Intelligence 9. Resolution Theorem Proving Course V231 Department of Computing Imperial College Jeremy Gow

The Full Resolution Rule If Unify(Pj, ¬Qk) =  (¬ makes them unifiable) P1  …  Pm, Q1  …  Qn Subst(, P1  … (no Pj) …  Pm  Q1  … (no Qk) ... Qn) Pj and Qk are resolved Arbitrary number of disjuncts Relies on preprocessing into CNF

A More Concise Version E.g. for A = {1, 2, 7} first clause is L1  L2  L7

Resolution Proving Knowledge base of clauses Resolve pairs of clauses Start with the axioms and negation of theorem in CNF Resolve pairs of clauses Using single rule of inference (full resolution) Resolved sentence contains fewer literals Proof ends with the empty clause Signifies a contradiction Must mean the negated theorem is false (Because the axioms are consistent) Therefore the original theorem was true

Empty Clause means False Resolution theorem proving ends When the resolved clause has no literals (empty) This can only be because: Two unit clauses were resolved One was the negation of the other (after substitution) Example: q(X) and ¬q(X) or: p(X) and ¬p(bob) Hence if we see the empty clause This was because there was an inconsistency Hence the proof by refutation

Resolution as Search Initial State: Knowledge base (KB) of axioms and negated theorem in CNF Operators: Resolution rule picks 2 clauses and adds new clause Goal Test: Does KB contain the empty clause? Search space of KB states We want proof (path) or just checking (artefact)

Aristotle’s Example (Again) Socrates is a man and all men are mortal Therefore Socrates is mortal Initial state 1) is_man(socrates) 2) is_man(X)  is_mortal(X) 3) ¬is_mortal(socrates) (negation of theorem) Resolving (1) & (2) gives new state (1)-(3) & 4) is_mortal(socrates)

Aristotle’s Example: Search Space 1) is_man(socrates) 2) is_man(X)  is_mortal(X) 3) ¬is_mortal(socrates) 1) is_man(socrates) 2) is_man(X)  is_mortal(X) 3) ¬is_mortal(socrates) 4) is_mortal(socrates) 1) is_man(socrates) 2) ¬is_man(X)  is_mortal(X) 3) ¬is_mortal(socrates) 4) ¬is_man(socrates) 1) is_man(socrates) 2) is_man(X)  is_mortal(X) 3) ¬is_mortal(socrates) 4) is_mortal(socrates) 5) False 1) is_man(socrates) 2) is_man(X)  is_mortal(X) 3) ¬is_mortal(socrates) 4) ¬is_man(socrates) 5) False

Resolution Proof Tree (Proof 1)

Resolution Proof Tree (Proof 2)

Reading Proof Tree 2 You said that all men were mortal. That means that for all things X, either X is not a man, or X is mortal [CNF step]. If we assume that Socrates is not mortal, then, given your previous statement, this means Socrates is not a man [first resolution step]. But you said that Socrates is a man, which means that our assumption was false [second resolution step], so Socrates must be mortal.

Russell & Norvig Example

¬A  ¬C  B becomes (A  C)  B Reminder: Kowalski NF Can reintroduce  to CNF, e.g. ¬A  ¬C  B becomes (A  C)  B Kowalski normal form (A1 … An)  (B1 … Bn) Resolve in KNF using ‘KNF style’ rules e.g. Binary resolution… AB, BC AC

R&N Example: Kowalski NF

R&N Example: Proof Tree

R&N Example: Prover9 Input

R&N Example: Prover9 Proof

Equality Axioms is_pres(obama) and is_pres(b_obama) will not unify (syntactically different) unification algorithm does not allow this Even if we add to the knowledge base: obama = b_obama Solution: add equality axioms to KB X=X, X=YY=X, etc. Special axiom for every predicate/function: X = Y  P(X) = P(Y)

Equality & Demodulation Alternative solution: rewrite with equalities Demodulation inference rule X=Y, A[S] Subst(, A[Y]) Two input clauses (one an equality X=Y) Unify X with a subterm S of other Apply unifier to clause with subterm Y (not S) Also works unifying with Y and putting in X Unify(X, S) = 

Heuristic Strategies Pure resolution search tends to be slow For interesting problems Many clauses in the initial knowledge base Each step adds a new clause (which can be used) Num. of possible resolution combinations explodes Selection Heuristics Intelligently choose which pair to resolve Pruning Heuristics Forbid certain pairs

Unit Preference Strategy Prefer to resolve unit clauses Contain only a single literal Selection heuristic Searching for smallest (empty) clause Resolving with the unit clauses keeps small Very effective early on for simple problems Doesn’t reduce branching rate for medium problems

Set of Support Strategy Distinguished subset of KB clauses Set of support (SOS) clauses Every step must involve SOS (pruning heuristic) Must be careful not to lose completeness Example SOS strategy: Initial SOS is negated theorem Add new clauses to SOS Hence False will be deduced (strategy is complete) Many provers use SOS, e.g. Prover9

Input Resolution Strategy Special case of SOS strategy SOS = clauses in the initial knowledge base Clearly reduces search space Every resolution must involve an original clause So number of possible resolutions grows slowly Not complete for first order logic But complete for Horn-clauses, e.g. Prolog

Subsumption Clause C subsumes clause D Naive check for subsumption if C is more ‘general’ (D is more specific) Naive check for subsumption Select C2, a subset of literals of C Find Unify(C2, D) =   does not add anything to D (only renames vars) Example: p(george) ∨ q(X) subsumed by p(A) ∨ q(B) ∨ r(C) Substitution: {A/george, X/B} Second clause is more general

Subsumption Strategy Check each new clause is not subsumed by KB Complete strategy Specific clauses can be inferred from general ones So we can throw specific clauses away Reduced search space still contains False Can be inefficient expense must be outweighed by the reduction in the search space

Applications: Axioms for Algebras Bill McCune and Larry Wos Argonne National Laboratories FO resolution provers: EQP, Otter, Prover9 Robbins Problem (axioms of Boolean algebras) Stated 60+ years ago, mathematicians failed 1996: EQP solved in 8 days in 1996 (+human work) General application to algebraic axiomatisations Generate possible axioms for algebras Prove new axioms equivalent to old

Applications: Theory Formation Simon’s HR system: Automated Theory Formation Used in mathematical (and bioinformatics) domains Theories = concepts, examples, conjectures, proofs HR uses Otter to prove conjectures it makes Effective in algebraic domains See notes for anti-associative algebra results Otter not so effective in number theory Used as a ‘triviality’ filter (discard theorems it can prove) Example conjectures made by HR (and proved by Simon): Sum of divisors is prime → number of divisors is prime Sum of divisors of a square is an odd number Perfect numbers are pernicious [and many more…..]

Inductive Theorem Proving Deduction by mathematical induction Induction over many different structures Allows reasoning about recursion/iteration Useful for hardware/software verification Don’t confuse inductive learning (next lecture)

Interactive Theorem Proving Necessary to interact with humans in order to prove theorems of any difficulty Mathematician’s assistant Let a theorem prover do simple tasks while you develop a theory (e.g., Buchberger’s Theorema) Guided theorem prover User follows and guides computer proof attempt Needs visualisation tools for proof trees

Higher Order Theorem Proving Deduction in higher order logics See lecture 4 Allows more natural and succinct statements Logics much less well-behaved HOL theorem prover Larry Paulson’s group in Cambridge Has been used for verification tasks E.g. verification of crytographic protocols Uses induction and interactive control

Proof Planning Initially Alan Bundy’s group in Edinburgh Human proofs often follow a similar structure Express this as a outline plan Methods represent a patterns of deduction Outline plan guides proof search Results in specific plan for theorem Critics deal with common problems Particularly useful for inductive theorems Proof of base case and step case follow pattern

Databases & Competitions TPTP library (Sutcliffe & Suttner) Thousands of Problems for Theorem Provers Benchmarks for first order provers HR is only non-human to add to this library Annual CASC competition (Sutcliffe et al.) Which is fastest/most accurate FO prover on planet? Uses blind selection from the TPTP library 2002-08 champion: Vampire (Voronkov & Riazonov)