Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
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.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Automated Reasoning Systems For first order Predicate Logic.
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.
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.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Logic.
Logic Concepts Lecture Module 11.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
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.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
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
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Knoweldge Representation & Reasoning
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
0 1 Todays Topics Resolution – top down and bottom up j-DREW BU procedure Subsumption – change to procedure Infinite Loops RuleML input – Prolog output.
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.
UIUC CS 497: Section EA Lecture #3 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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.
Marriage Problem Your the sovereign in a small kingdom. One of your jobs is to marry off the people in kingdom. There are three rules that apply.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
First Order Predicate Logic
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
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.
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 Systems For first order Predicate Logic.
Reasoning using First-Order Logic
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
© 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.
Lecture 9a: Resolution Strategies Heshaam Faili University of Tehran Restriction strategies for resolution Horn clauses.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
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.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Introduction to Logic for Artificial Intelligence Lecture 2
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Horn Clauses and Unification
Horn Clauses and Unification
Prolog IV Logic, condensed.
Horn Clauses and Unification
Horn Clauses and Unification
Biointelligence Lab School of Computer Sci. & Eng.
Horn Clauses and Unification
RESOLUTION.
Resolution Proof System for First Order Logic
Presentation transcript:

Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original set, thus generating a new set of clause. The next step is trying to resolve every new clause against every new clause and every original clause, generating another new set. Then try to resolve those new clauses against themselves and the previous clauses.

Restrictions of Resolution Several ways to restrict the possible resolutions are: Unit resolution – one of the two clauses resolved upon must be a unit clause (a single literal)‏ Input resolution – one of the two clauses resolved upon must be from the original set of clauses Linear resolution – after the first resolution step, one of the two clauses resolved upon must be the last clause generate. These restrictions are sound, but not complete. Why?

Subsumption One strategy that is complete is subsumption. On clause subsumes another (in proposition calculus) if it is a subset of the other clause. As we are trying to obtain the empty clauses, smaller clauses are better. So, if a clause subsumes another clauses, that other clause may be eliminated. This works in both the forward direction (a new clause is subsumed by and old clause) and the backward direction (an old clause is subsumed by a new clause).

Deletion Strategy Delete any tautology or clause subsumed by another.

Predicate Calculus Resolution also works for the predicate calculus, but is more complicated (of course!). In particular, reducing a formula to a clause set requires more work, and we have to pay attention to the murder rule.

Prenex Form (From Chang and Lee, Symbolic Logic and Mechanical Theorem Proving)‏ Prenex form occurs when the quantifiers all occur to the left of the formula, that is a formula of the form (Q 1 x 1 ) (Q 2 x 2 ) (Q 3 x 3 ) (M), where Q 1, Q 2, Q 3,... are either ∀ or ∃, and M is a quantifier-free formula, called the matrix.

Prenex Form (cont'd)‏ To put a formula into prenex form, we do the following steps: 1. Get rid of -> and by using the equivalences F G = (F -> G) ^ (G -> F) and F -> G = ~F v G. 2. Push ~ in to the atoms by using the equivalences ~~F = F, ~(F v G) = ~F ^ ~G, ~(F ^ G) = ~F v ~G. 3. Rename bound variables if necessary. 4. Move the quantifiers to the outside.

Moving Quantifiers to the Outside We use the following equivalences: (Q x) F(x) v G = (Q x) (F(x) v G)‏ (Q x) F(x) ^ G = (Q x) (F(x) ^ G ( ∀ x) F(x) ^ ( ∀ x) H(x) = ( ∀ x) (F(x) ^ H(x))‏ ( ∃ x) F(x) v ( ∃ x) H(x) = ( ∃ x) (F(x) v H(x))‏ (Q 1 x) F(x) v (Q 2 x) H(x) = (Q 1 x) (Q 2 z) (F(x) v H(z))‏ (Q 1 x) F(x) ^ (Q 2 x) H(x) = (Q 1 x) (Q 2 z) (F(x) ^ H(z))‏

Prenex Form - Example ( ∀ x) ( ∀ y) (( ∃ z) (P(x,z) ^ P(y,z)) -> ( ∃ u) Q(x,y,u))‏

Skolem Standard Form To achieve Skolem Standard form, we do the following; Transform the formula into prenex normal form. Put the matrix into conjunctive normal form (CNF). Eliminate the existentially quantified variables by using Skolem functions (and constants)‏ Drop the universal quantifiers as only universally quantified variables remain.

Skolem Functions Consider the formula ( ∀ x) ( ∃ y) x >= y. That is, for every x, there is some y less than x. If that's the case, we could create a function smaller(x) that, given an x, returns some number smaller than x. There are many such functions, by the formula guarantees that one exists. Consider the formula ( ∀ x) x >= smaller(x). These two formulas are not equivalent under an interpretation (why?) but one is unsatisfiable iff the other is unsatisfiable (why?)‏

Skolem Functions (cont'd)‏ We can replace each existentially quantified variable by a new Skolem function whose arguments are all the universally quantified variable to the left of its quantifier – as those are the values that the existentially quantified variable depends on. If there are no universally quantified variables to the left, we replace the variable by a function of no arguments, or a constant. Once we have no existentially quantified variables, we drop the ∀ 's.

Skolem Normal Form - Example ( ∃ x) ( ∀ y) ( ∀ z) ( ∃ u) ( ∀ v) ( ∃ w) P(x,y,z,u,w)‏

Resolution The resolution procedure for predicate calculus is a refutation procedure. The steps are: Negate the formula Put the formula into Skolem Standard form (which requires putting it into prenex for first)‏ Write the formula as a set of clauses Use the resolution rule repeatedly to find the empty clause (box) if possible.

Binary Resolution Rule The resolution rule for predicate calculus is a bit more complicated because of the presence of variables. Two literals don't have to be exactly the same, but rather could unify. The binary resolution rule corresponds to the marriage rule: If C 1 and C 2 are two clauses with no variables in common and L 1 and L 2 are two literals in C 1 and C 2, respectively, where L 1 and ~L 2 have the mgu σ, then the clause ( σ (C 1 )- σ (L 1 ) U ( σ (C 1 )- σ (L 1 ) is the binary resolvent of C 1 and C 2.

Factors For propositional calculus, the murder rule simply means that the clauses are sets. For predicate calculus, since we have variables, we must deal with the case when two (or more) literals in a single clause unify: If two (or more) literals (with the same sign) of a clause C have an mgu σ, then σ (C) is called a factor of C.

Resolution Rule for Pred. Calc. Remembering that a murder may only occur the night before a wedding, we now have the (full) resolution rule: A resolvent of two clauses C 1 and C 2 is a binary resolvent of C 1 or a factor of C 1 and C 2 or a factor of C2.

Resolution Rule - Example C 1 = P(x) v P(f(y)) v R(g(y))‏ C 2 = ~P(f(g(a))) v Q(b)‏

Resolution Procedure Resolution is sound and complete. Many of strategies used in propositional calculus resolution apply to predicate calculus (with modification). Level saturation is the same. A clause C 1 subsumes a clause C 2 iff there is a substitution σ such that σ (C 1 ) ⊆ C 2. The deletion strategy used this new definition of subsumption. Unit, input, and linear resolution are the same.

Other Strategies - Definitions Definitions: A clause is called positive is it does not contain any negative literals. A clause is called negative if it does not contain any negative literals. A clause is called mixed if it is neither positive nor negative.

Positive Hyperresolution In positive hyperresolution, a single step is a series of resolution steps between a nucleus, (a negative or mixed clause) and several electrons (positive clauses). The result must be a positive clause, i.e., the electrons must knock out all the negative literals in the nucleus. Example: R(x) v R(a), S(x), ~R(a) v ~S(a) -> □.

Negative Hyperresolution Negative Hyperresolution is just like positive hyperresolution except that the nucleus is positive or mixed and the electrons are negative clauses.

Set of Support Resolution A subset T of a set of clauses S is called a set of support if S – T is satisfiable. For example, given a theorem with hypothesis and a conclusion, the hypotheses are normally satisfiable, so T could be the clauses formed by the conclusion. A set-of-support resolution is one in which both parent clauses are not from S – T. A set-of-support deduction is one where every resolution is a set-of-support resolution.

Automated Theorem Provers Otter – Argonne National Lab, McCune Prover9 - McCune SETHEO – Technical University of Munich E-SETHEO - TUM Vampire- Manchester University, Voronkov

Users of Automated Thm. Proving Mathematical Proof Proof-checking Program Verification Question Answering General Reasoning Combine with other Reasoning Modules

Horn Clauses A Horn clause is a restricted predicate calculus formula of form P 1 ^ P 2 ^ P 3 ^... P n -> Q or just Q The formulas P i and Q must be positive literals.

Queries Given a set of Horn clauses (the hypotheses) and a query (the conclusion), we can easily check if the query is true. A ^ B ^ C -> D B -> C A E A ^ E -> B D

Proof One systematic way is to keep a stack of goals yet to be proved. Begin by pushing the conclusion (D) on the stack. While the stack is not empty, pop the stack to get the current goal. If a fact (atomic clause) matches the goal, return T. If not, search for an implication whose right-hand side matches the goal, and then push all the conjuncts from the left-hand side onto the stack (if not already there).

Example D (conclusion)‏ A B C (matches first clause)‏ B C (A is a fact)‏ A E C (matches fifth clause)‏ E C (A is a fact)‏ C (E is a fact)‏ B (matches second clause)‏ A E (matches fifth clause)‏ E (A is a fact)‏ (E is a fact)‏

Resolution Alternatively we could use resolution. Written as a clause set (with the conclusion negated) we have: ~A v ~B v ~C v D ~B v C A E ~A v ~E v B ~D A restricted form of resolution called LUSH or SLD works fine for these sets.

Lists We can add a list constructor to this language: [] means the empty list, and cons(x,y) means the list with first element x and the remainder is y (so x is added to the beginning of list y). We can use standard list notation as shorthand for our lists. So, the list cons(a, cons(b, cons(c, []))) would be written [a,b,c]. We also use the vertical bar (|) with brackets to be shorthand for cons – [x|y] means cons (x,y).

Statements about Lists We can use this notation to define list operations: member(x, [x | y])‏ member(x, z) -> member(x, [y | z])‏ means that x is a member of a list which has x as its head, and if x is a member z, then x is a member of the list constructed by adding y to the head of z.

Sorting What does it mean if one list is the sorted version of another list? For example, consider [3,1,4,2] and [1,2,3,4]. The both must have the same members, and the second list must be in order. We assume that we have predicates for the usual mathematical relations such as <=. So, to state that a list is in order we could say:

Sorting (cont'd)‏ inOrder([y | z])^(x inOrder([x, y | z])‏ inOrder([])‏ inOrder([x])‏

Same Elements To check if two lists have exactly the same member is a little more complicated. To state this property, we use a three argument member predicate which removes the member of the list, i.e., member(x, y, z)‏ means that x is a member of y and that z is the result of removing (one instance of) x from y. So member(3,[1,2,3,4],[1,2,4]) is true.

Same Elements (cont'd)‏ member(x, [x | y], y)‏ member(x, y, z) -> member(x, [w | y], [w | z])‏ sameElements([], [])‏ sameElements(y, z), member(x, w, z) -> sameElements([x | y], w)‏

Sorting sameElements(x,y) ^ inOrder(y) -> sorted(x,y)‏ sameElements([], [])‏ sameElements(y, z), member(x, w, z) -> sameElements([x | y], w)‏ member(x, [x | y], y)‏ member(x, y, z) -> member(x, [w | y], [w | z])‏ inOrder([y | z])^(x inOrder([x, y | z])‏ inOrder([])‏ inOrder([x])‏

Prolog sorted(L1,L2) :- sameElements(L1,L2), inOrder(L2). inOrder([X,Y|L]) :- X =< Y, inOrder([Y|L]). inOrder([]). inOrder([_]). sameElements([],[]). sameElements([X|L1],L2) :- sameElements(L1,L3), member(X,L2,L3). member(X,[X|L],L). member(X,[Y|L],[Y|L1]) :- member(X,L,L1).

Prolog (cont'd)‏ Prolog is a language built on top of a resolution theorem prover. So the specification of the program is (or can be) the executable program. We blur the distinction between the declarative and the procedural.