First Order Logic Resolution

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
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
Resolution.
Automated Reasoning Systems For first order Predicate Logic.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
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.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
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 Concepts Lecture Module 11.
Predicate Calculus Russell and Norvig: Chapter 8,9.
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.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
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.
AI - Week 16 Logic and Reasoning in AI: Resolution Refutation Lee McCluskey, room 2/07
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
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
The Semantic Web – WEEK 8: An automatic Proof technique.. The “Layer Cake” Model – [From Rector & Horrocks Semantic Web cuurse] You are here!
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
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.
First Order Predicate Logic
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
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.
1CS3754 Class Notes 14B, John Shieh, Figure 2.5: Further steps in the unification of (parents X (father X) (mother bill)) and (parents bill.
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.
Unification We can represent any substitution by a set of ordered pairs: s = { t 1 /v 1, t 2 /v 2, …, t n /v n } where: t i /v i means that the term i.
Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.
Scope, free variable, closed wff §In  X(A) or  X(A), where A is a wff : X is called the variable quantified over; A is said to be (within) the scope.
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.
Extra slides for Chapter 3: Propositional Calculus & Normal Forms Based on Prof. Lila Kari’s slides For CS2209A, 2009 By Dr. Charles Ling;
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 25 A First Course in Database Systems.
Reasoning using First-Order Logic
The Law of Resolution Formal Aspects of Computer Science - Week 7 The Law of Resolution Lee McCluskey, room 2/07
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.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Converting arbitrary wffs to CNF A wff is in prenex form iff it consists of a string of quantifiers (called a prefix) followed by a quantifier free formula.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Introduction to Logic for Artificial Intelligence Lecture 2
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Propositional Logic Resolution
Biointelligence Lab School of Computer Sci. & Eng.
Prolog IV Logic, condensed.
Biointelligence Lab School of Computer Sci. & Eng.
RESOLUTION.
Resolution in predicate Logic
Resolution Proof System for First Order Logic
Presentation transcript:

First Order Logic Resolution Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara rdav90@gmail.com

Unification We can represent any substitution by a set of ordered pairs: s = { t1/v1, t2/v2, …, tn/vn} where: ti/vi means that the term i substitutes variable i throughout the expression. e.g. s1 = {b/x, a/y, a/z} Note: - every occurrence of a variable should be substituted by the same term. - no variable can be replaced by a term that contains the same variable. Def. To denote a substitution instance of an expression E, using a substitution s, we write: Es.

Unification Def. Finding substitutions of terms for variables to make two or more expressions identical is called unification. e.g. {p(g(x,f(y)),a), p(g(b,f(z)),y)} ==> p(g(b,f(a)),a) Def. A substitution instance of an expression is obtained by substituting terms for variables in that expression. Def. A ground instance of an expression is one in which there are no variables (and consequently, no quantifiers). Def. An instance of an expression which results from changing just the names of the variables in it, is called an alphabetic variant of the original. e.g. x.p(x,f(x,b)) ==> z.p(z,f(z,b))

Unification Def. A composition of two substitutions s1 and s2 is written s1s2, and it is accomplished following the steps: - apply s2 to the elements of s1. - add any pairs of s2 having variables not occurring in s1. e.g. s1={g(x,y)/z}, s2={a/x, b/y, c/w, d/z} s1s2 ==> {g(a,b)/z, a/x, b/y, c/w} s2s1 ==> {a/x, b/y, c/w, d/z} = s2 Some properties of composition are: 1. (Es1)s2=E(s1s2) 2. s1(s2s3)=(s1s2)s3

Unification Def. We say that a set {Ei} of expressions is unifiable if there exists a substitution s that makes: E1s=E2s=…=Ens. Def. If a substitution g has the property that if s is a unifier of {Ei} yielding {Ei} s, then there exists a substitution s’ such that {Ei} s={Ei} gs’, then g is called the most general unifier mgu. For the unify procedure presented next, it is assumed that its arguments are two lists of expressions. e.g. g(r(x,f(z)),y) ==> [g, [r, x, [f, z ]], y] g(r(a, y), u) ==> [g, [r, a, y], u]

Unification Algorithm Procedure UNIFIY (E1, E2) If either E1 or E2 is an atom { if E1 and E2 are identical, return NIL if E1 is a variable, do: { if E1 occurs in E2, return FAIL return {E2/E1} } if E2 is a variable, return {E1/E2} return FAIL F1  the first element of E1 T1  the rest of E1 F2  the first element of E2 T2  the rest of E2 Z1  UNIFY(F1, F2) If Z1 = FAIL, return FAIL G1  result of applying Z1 to T1 G2  result of applying Z1 to T2 Z2  UNIFY(G1, G2) If Z2 = FAIL, return FAIL Return the composition of Z1 and Z2 ________________________ Procedure taken from Nilsson N.J. “Principles of Artificial Intelligence”, Tioga Publishing, California 1980.

Clausal Form 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 normal form if it consists in the conjunction of clauses. A1  A2  …  An where Ai is a clause. Def. A formula is said to be a clause if it consists in a disjunction of literals. A clause has the following form: L1 v L2 v … v Lm where Li is a literal. Def. A literal is an atomic formula or the negation of an atomic formula. Def. A formula is said to be in clausal form if it can be expressed as a set of clauses: {C1 , … , Cn,} where Ci is a clause

Transforming to Clausal Form 1. Eliminate implication symbols (), using the identity:     ~ v  2. Introduce negation: reduce scopes of negation symbols by repeatedly applying the De Morgan rules and the quantifier identities: (i) ~( v )  ~  ~ (ii) ~(  )  ~ v ~ (iii) ~x. (x)  x. ~(x) (iv) ~x. (x)  x. ~(x)

Transforming to Clausal Form 3. Transform into prenex normal form: Def. A formula is in prenex normal form if it consists in a list of quantifiers called prefix, followed by a quantifier-free formula called the matrix. Procedure (i) Standardize variables: re-name variables. (ii) Eliminate existential quantifiers: replace all existential quantifier’s variables by skolem functions of all the universal quantified variables which are over the scope of the existential quantifier. (iii) Move all quantifiers to the left: there remain only universal quantifiers.

Transforming to Clausal Form 4. Put matrix in conjunctive normal form by repeatedly using the distributive laws: (i)  v (  )  ( v )  ( v ) (ii)   ( v )  (  ) v (  ) 5. Eliminate universal quantifiers. 6. Eliminate conjunction () symbols separating in clauses. 7. Rename variables.

Predicate logic resolution Example: x. (p(x)  {y. [p(y)  p(f(x,y))]  ~y. [q(x,y)p(y)]}) ===> gets transformed into the following clauses: c1: ~p(x1) v ~p(y) v p(f(x1,y)) c2: ~p(x2) v q(x2, g(x2)) c3: ~p(x3) v ~p(g(x3))

Resolution Refutation Systems We can use production systems to show that a given formula, called the goal, is a theorem derivable from a set of formulas (they provide the state description). These production systems are called theorem proving systems or deduction systems. Resolution Refutation Systems are based in the following principle:  =  if and only if,   {~} =

Resolution Refutation Systems Resolution refutation procedure In general a resolution refutation proving that an arbitrary wff  fallows from a set of wffs ,  |= , proceeds as follows: 1. Convert the wffs in  to clausal form. 2. Negate the formula  to be proved and convert the resulting formula, ~ , into to clausal form. 3. Combine the clauses resulting form steps 1 and 2 into a single set, . 4. Iteratively apply resolution to the clauses in  and add the results to  either until there are no more resolvents that can be added or until the empty clause is produced.

Resolution Refutation Systems Def. Resolution Rule: p v q1 v q2 v … v qn ~p v r1 v r2 v … v rm ------------------------------------------------- q1 v … v qn v r1 v … v rm e.g. 1. Whoever can read is a literate. Dolphins are not literate.Some dolphins are intelligent. Hence, some who are intelligent can not read. 2. (c1) p(x,f(a)) v p(x,f(y)) v q(y) (c2) ~p(z,f(a)) v ~q(z)

Resolution Refutation Systems Example: Tiger and savages animals are fierce or destructives. If there is something destructive in the room, then something in the room will get damaged. Tim is a tiger. Tim is a savage animal. Tim is in the room but it is not fierce. Prove using resolution that something in the room will get damaged.

Predicate logic resolution Important results Completeness of resolution refutation: the empty clause will be produced by the resolution refutation procedure if  |= , thus we say that predicate calculus resolution is refutation complete. Decidability of predicate calculus resolution refutation: We say that resolution refutation in predicate calculus is semi-decidable as it terminates by generating the empty clause if  |= , but it may never terminate if  | .

Predicate logic resolution Simplification strategies Sometimes a set of clauses can be simplified by elimination of certain clauses or elimination of certain literals in the clauses. Elimination of tautologies Any clause containing a literal and its negation may be eliminated. E.g. p(x) v q(y) v ~ q(y) ==> T Procedural attachment Sometimes it is possible to evaluate the truth values of literals:  v F ==>  e.g. p(x) V q(y) V ( 3 >7) ==> p(x) V q(y) since we already know that 3>7 is false.

Predicate logic resolution Elimination by subsumption Def. A clause {Li} subsumes a clause {Mi} if there exists a substitution s such that {Li}s is a subset of {Mi}. e.g. p(x) subsumes p(y) v q(z) p(x) subsumes p(a) p(x) subsumes p(a) v q(z) p(x) v q(a) subsumes p(f(a)) v q(a) v r(y) A clause in an unsatisfiable set that is subsumed by another clause in the set can be eliminated without affecting the unsatisfiability of the rest of the set.

Predicate logic resolution Extracting answers from Resolution Refutations Many applications of theorem-proving systems involve proving formulas containing existentially quantified variables and finding values or instances for these variables. To get an answer the proof method has to be constructive. E.g. “If Fido goes wherever John goes and if John is at school, where is Fido?” To answer this question first we must have to proof of the goal: z. at(fido,z) Next: we must extract the answer to the question from this refutation tree. In order to do that we proceed as follows: (a) append to each clause arising from the negation of the goal wff its own negation. (b) Following the structure of the refutation tree, perform the same resolutions as before until some clause is obtained at the root. (c) Use the clause at the root as an answer statement.

Predicate logic resolution Extracting the answer involves converting a refutation tree (with NIL at the root) to a proof tree with some statement at the root that can be used as an answer. The conversion involves converting every clause arising from the negation of the goal into a tautology. Another example: For all x, y, there exists a z, such that if parent(x,y) & parent(y,z)  grandfather(x,z) And, everyone has a parent: x.y.parent(x,y) Question: “Do there exists individuals x and y such that x is the grandparent of y.” it can be expressed as: x.y.g(x, y)

Predicate logic resolution Universally quantified variables in goals A problem when a universal quantified variable appears on the goal is that after the goal is negated we have an existencially quantified variable which is Skolemized and a function is introduced. What is the meaning of this Skolem function and how it has to be interpreted when extracting the answer? Steps: A resolution-refutation tree is found by some search process. The unification subsets of the clauses of the tree are marked. New variables are substituted for any Skolem functions occurring in the clauses that result from the negation of the goal wff. The clauses resulting from the negation of the goal wff are converted into tautologies by appending to them their own negations.

Predicate logic resolution 4. A modified proof tree is produced modeling the structure of the original refutation tree. Each resolution in the modified tree uses a unification set determined by the unification set used by the corresponding resolution in the refutation tree. The clause at the root of the modified tree is the answer statement extracted by these process. It can be shown [Luckham and Nilsson, 1971] that in the answer-extracting process it is correct to replace any Skolem functions in the clauses coming from the negation of the goal wff with new variables. _____________________ Luckham, D.C., and Nilsson, N. J. 1971. Extracting information from resolution proof trees. Artificial Intelligence, 2(1), 27-54.