Plan for the rest of the quarter TuesdayThursday Week 7ResolutionProof carrying code Week 8No class (Sorin in DC for workshop) Predicate abstraction (Mystery.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Some Prolog Prolog is a logic programming language
Resolution Proof System for First Order Logic
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
SLD-resolution Introduction Most general unifiers SLD-resolution
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Automated Reasoning Systems For first order Predicate Logic.
Artificial Intelligence
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)
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
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.
Logic.
Resolution in Propositional and First-Order Logic.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
CSE (c) S. Tanimoto, 2008 Propositional Logic
Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
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
` ² Q E D I Nelson-Oppen review
Methods of Proof Chapter 7, second half.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Knoweldge Representation & Reasoning
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Artificial Intelligence
After today Week 9 –Tu: Pat Rondon –Th: Ravi/Nathan Week 10 –Tu: Nathan/Ravi –Th: Class canceled Finals week –Th: Zach, John.
Course eval results More applications Last question –Luging: 0.5 –Curling: 1.5 –Figure skating: 2 –Ice fishing: 6.5 –Foosball: 0.5.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
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,
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.
Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.
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.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
Automated Reasoning Systems For first order Predicate Logic.
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.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
DEDUCTION PRINCIPLES AND STRATEGIES FOR SEMANTIC WEB Chain resolution and its fuzzyfication Dr. Hashim Habiballa University of Ostrava.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Introduction to Logic for Artificial Intelligence Lecture 2
Search techniques.
Presentation transcript:

Plan for the rest of the quarter TuesdayThursday Week 7ResolutionProof carrying code Week 8No class (Sorin in DC for workshop) Predicate abstraction (Mystery guest) Week 9Rewrite rulesInduction + inferring loop invariants Week 10Constructive logicFinal project presentations

So far Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy E-graph Communication between decision procedures and between prover and decision procedures DPLL Backtracking Incremental SAT Matching Natural deduction Sequents Tactics & Tacticals Today: Resolution

Resolution Originally developed by Robinson in 1965 Most proof systems at the time had aimed at human reasoning. They either: –Had many axioms (Hilbert style systems) –Or many inference rules (Natural deduction, Sequent calculus) Robinson wanted to explore the possibility of having a simple calculus –with few but powerful axioms and inference rules –not necessarily intuitive form a human perspective, but more amenable to automated reasoning.

Resolution Resolution calculus is far simpler than any of the other proof systems we have seen so far –There is only one axiom and one inference rule This simplicity led many researchers to embrace the logic early on –One inference rule ) Can put all of our intellectual effort into making this one inference rule efficient Resolution is in fact still widely use today –Some of the most efficient fully automated theorem provers for first-order logic (E, Gandalf, Spass, Vampire) use variations of the resolution logic

Propositional resolution `` `  ) l`  ) l  ` l )  RES

Propositional resolution Where have we seen this idea before?  `  )  `  ) l`  ) l  ` l )  RES

Propositional resolution  `  )  `  ) l`  ) l  ` l )  RES  ` :  Ç   ` :  Ç l  ` : l Ç  RES Expand )  `  Ç   `  Ç l  ` : l Ç  RES Generalize  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES Generalize even more

Propositional resolution  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES resolvent

Propositional resolution  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES Which direction should we apply this rule in? resolvent

Propositional resolution  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES  `  Assume

Relation to other inference rules  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES

 ` l  ` l )  Relation to other inference rules Recall Modus Ponens:  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES ` `  MP  ` l  ` : l Ç  ` `  MP Expand ) MP is a special case of RES (with ,  and  set true)

Relation to other inference rules  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES

Relation to other inference rules Recall cut rule:  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES  ` , l l,  `  ,  ` ,  CUT  ` , l  ` , : l ,  ` ,  CUT  `  Ç l  `  Ç  : l ,  `  Ç  Resolution rule embodies the same idea as the cut rule from Sequents Throw l to the other side “Expand” definition of sequents

Example Proof Find a derivation of { : P Ç Q, S Ç P, : Q Ç R, : R } ` S  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Example Proof Find a derivation of { : P Ç Q, S Ç P, : Q Ç R, : R } ` S Is the proof unique?  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Proof is not unique Find a derivation of { : P Ç Q, S Ç P, : Q Ç R, : R } ` S  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Another example Find a derivation of: {} ` A Ç : A  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Another example Find a derivation of: {} ` A Ç : A Can’t find a derivation –There are no clauses to resolve! We made the calculus very simple (with only one axiom, and one inference rule) –but we also made it incomplete What should we do?  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Try refutation We have seen refutation in the semantic domain –To show that a goal is valid, show that its negation is unsatisfiable –We can apply the idea in the proof domain In the context of the proof domain: –To show that a goal is valid, assume its negation, and derive false

Try refutation Find a derivation of: {} ` A Ç : A  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Try refutation Find a derivation of: {} ` A Ç : A Refutation worked in this case Q: Would it always work if the formula is valid?  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç 

Refutation A: Yes Although resolution is incomplete, it is refutation complete, which means that if the formula is valid, then adding its negation to the assumptions makes false provable More formally… Recall defn of completeness: –If  ²  then  `  Defn of refutation complete: –If  ²  then  ` false

Forward refutation-based resolution search Keep a knowledge base, which is the set of formulas that have been inferred so far Given goal to prove: –Add negation of goal to the knowledge base –While false not in knowledge base: Choose two formulas to resolve Add resolvant formula to the knowledge base If false is in the knowledge base, return VALID

Key issue: non-determinism Source of non-determinism: need to determine which clauses to resolve Two main approaches for handling these non- determinism –Simplification strategies –Ordering clauses

Simplification strategies Simplification strategies remove redundant clauses from the knowledge base –Reduces number of choices, but also makes the search more space efficient Example 1: remove a clause C if it contains a literal l that is not complimentary with any other literal in the remaining clauses –Intuition: l will never get resolved upon, and so resolvents derived from C (directly or indirectly) will therefore at least contain l, and thus cannot possibly be the empty clause

Simplification strategies Example 2: tautologies can be removed, where a tautology can be detected by checking if a clause contains both a literal and its negation Example 3: remove clauses that are implied by other clauses in the set –This is called subsumption –Various forms of it, depending on how the implication is tested, and when during the search the test is done

Ordering (clause selection) strategies A good clause selection strategy is critical for finding proofs efficiently Many ways to order clauses… Just the E theorem prover (which won various automated theorem proving competitions) implements over 60 predefined clause selection schemes

Ordering (clause selection) strategies Favor small clauses first, an instance of which is the idea of favoring one-literal clauses (unit resolution) Favor old clauses –Corresponds to a FIFO order and leads to a breadth first ordering Opposite strategy: always resolve the newest resolvent, which leads to a depth first search –Such strategies are called linear strategies because they create a linear chain of resolvents, each produced from the previous one –One such strategy, called SLD-resolution is at the core of Prolog

Example of SLD-resolution Assume: B 1 B 2 B 1 Æ B 2 ) A (in prolog, written: A :- B 1, B 2 ) B 3 Æ B 4 ) A (in prolog, written: A :- B 3, B 4 ) Query: A

Example of SLD-resolution Assume: B 1 B 2 B 1 Æ B 2 ) A (in prolog, written: A :- B 1, B 2 ) B 3 Æ B 4 ) A (in prolog, written: A :- B 3, B 4 ) Query: A

Another issue: finding complementary terms Efficient data structures have been devised for efficiently finding complementary terms Graph based data structure of Kowalski –Complementary literals connected with graph edges –When a resolvent is added, use existing edges in the graph to add the appropriate new edges Indexing is another technique for efficiently determining which clauses to resolve –For example, answer queries such as: given a literal l, return all clauses that contain literals that unify with : l

First-order resolution So far, we’ve seen propositional resolution Now we’ll take look at the first-order case However, before we do that, let’s take a detour to see a new technique for handling universal quantifiers in axioms: unification

Universals with unification Given a universal axiom, our goal is to instantiate the universal with the right term t Key idea –Instead of determining immediately what term to instantiate the universal, introduce a new fresh variable v which stands for the term t –At later stages in the proof, the variable v is gradually constrained until either its value is known, in which case the proof succeeds, or the system determins that no value for v is appropriate, in which case the proof fails –The constraints arise from unification

Overview of unification Given two terms or formulas x and y, unifiy(x,y) returns a substitution  such that  (x) is syntactically the same as  (y). If no such  exists, the unification fails Examples –unify(P(f(x),y), P(z, g(s)) = –unify(P(x,y), P(y,x)) = –unify(P(x, g(y)), P(f(y), x) = –unify(P(x), P(f(x)) =

Overview of unification Given two terms or formulas x and y, unifiy(x,y) returns a substitution  such that  (x) is syntactically the same as  (y). If no such  exists, the unification fails Examples –unify(P(f(x),y), P(z, g(s)) = –unify(P(x,y), P(y,x)) = –unify(P(x, g(y)), P(f(y), x) = –unify(P(x), P(f(x)) =

Example Suppose we want to show: – 8 x. P(x) ` 8 x. P(f(x))

Example Suppose we want to show: – 8 x. P(x) ` 8 x. P(f(x))

Careful! Don’t confuse skolemization with the introduction of variables for later unification –Skolemization applies to universals that we are trying to prove, and it introduces constants –The introduction of fresh variables for unification applies to universals in assumptions, and it introduces variables Although in some cases the difference between fresh variables and fresh constants is irrelevant, in the context of unification, the difference is important: –A variable can be unified with any constant, whereas a constant can only be unified with the exact same constant For example, try showing f(0) ` 8 x. f(x)

Careful! Don’t confuse skolemization with the introduction of the variables for later unification –Skolemization applies to universals that we are trying to prove, and it introduces constants –The introduction of fresh variables for unification applies to universals in assumptions, and it introduces variables Although in some cases the difference between fresh variables and fresh constants is irrelevant, in the context of unification, the difference is important: –A variable can be unified with any constant, whereas a constant can only be unified with the exact same constant For example, try showing f(0) ` 8 x. f(x)

First-order resolution We take the goal, negate it, and then: –We place the formula in prenex normal form, where quantifiers are on the outside –We remove existentials with skolemization (assumed existentials can be skolemized) We are only left with universals, for which we introduce fresh variables, in the hope of doing unification later on

First-order resolution  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES

First-order resolution  `  Ç  Ç  Ç   `  Ç l 1 Ç  `  Ç : l 2 Ç  GEN-RES  `  Ç  Ç  Ç   `  Ç l Ç  `  Ç : l Ç  RES  = unify ( l 1, l 2 )  Ç l 1 Ç  and  Ç : l 2 Ç  have no common vars

Simple example P(a,b) Ç : Q(a,b,c), : P(s,t) Ç R(s)

Simple example P(a,b) Ç : Q(a,b,c), : P(s,t) Ç R(s)

Complete example 8 x. R(x, f(x,x)) ) 8 x. 9 y. R(x, y)

Complete example 8 x. R(x, f(x,x)) ) 8 x. 9 y. R(x, y)

Proof-system search ( ` ) Interpretation search ( ² ) Main search strategy DPLL Backtracking Incremental SAT Natural deduction Sequents Resolution Main search strategy review More human friendly, Less automatable Less human friendly, More automatable