1 Hojjat Ghaderi, University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Knowledge Representation III ● Required Readings: 9.1, 9.2,

Slides:



Advertisements
Similar presentations
Resolution Proof System for First Order Logic
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
SLD-resolution Introduction Most general unifiers SLD-resolution
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
AR for Horn clause logic Introducing: Unification.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.
Standard Logical Equivalences
Resolution.
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.
CSC 685 Logic Review. Logic: Modeling Human Reasoning syllogistic logic Syllogistic Logic (Aristotle). all/some X are/not Y Propositional Logic (Boole).
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Logic seminar 5 The resolution principle Slobodan Petrović.
Inference and Resolution for Problem Solving
Catriel Beeri Pls/Winter 2004/5 type reconstruction 1 Type Reconstruction & Parametric Polymorphism  Introduction  Unification and type reconstruction.
CSE (c) S. Tanimoto, 2007 Unification 1 Unification Predicate calculus rules are sometimes so general that we need to create specializations of.
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
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.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
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.
Polynomials. Intro An algebraic expression in which variables involved have only non-negative integral powers is called a polynomial. E.g.- (a) 2x 3 –4x.
First Order Predicate Logic
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
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.
CS4026 Formal Models of Computation Part II The Logic Model Lecture 2 – Prolog: History and Introduction.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
Automated Reasoning Systems For first order Predicate Logic.
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.
General resolution Method1 General Resolution method in FOL Lesson 8.
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 Hojjat Ghaderi, University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Knowledge Representation IV ● Answer Extraction ● Factoring.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Resolution Preliminaries Computational LogicLecture 9 By Prof. Michael Genesereth, Computer Science, Stanford Univ Spring 2005 Modified by Charles Ling.
1 Section 9.2 Logic Programming A logic program is a set of clauses with the restriction that there is exactly one positive literal in each clause. Such.
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.
CPSC 433 Artificial Intelligence Unification & Resolution Examples Andrew Kuipers Please include [CPSC433] in the subject line.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
1 Introduction to Artificial Intelligence LECTURE 9: Resolution in FOL Theorem Proving in First Order Logic Unification Resolution.
Lecture 9: Resolution in First Order Logic Heshaam Faili University of Tehran Theorem Proving in First Order Logic Unification Resolution.
Introduction to Logic for Artificial Intelligence Lecture 2
CSE 341, S. Tanimoto Logic Programming -
The function of knowledge representation scheme is
Horn Clauses and Unification
General Resolution method in FOL
Prolog syntax + Unification
Unification Algorithm ChuChen
Soundness of SLD-Resolution
Horn Clauses and Unification
Horn Clauses and Unification
CSE (c) S. Tanimoto, 2004 Unification
CSE S. Tanimoto Unification
Horn Clauses and Unification
CSE (c) S. Tanimoto, 2002 Unification
Horn Clauses and Unification
Resolution Proof System for First Order Logic
Soundness of SLD-Resolution
Resolution Preliminaries
Presentation transcript:

1 Hojjat Ghaderi, University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Knowledge Representation III ● Required Readings: 9.1, 9.2, and 9.5 ● Announcements. ■ Office hours? ● Resolution Proofs. ■ Part I: Convert to clausal form ■ Part II: Dealing with variables (unification). ■ Part III: Constructing Resolution Proofs.

2 Hojjat Ghaderi, University of Toronto, Fall 2006 Unification ● Ground clauses are clauses with no variables in them. For ground clauses we can use syntactic identity to detect when we have a P and ¬P pair. ● What about variables can the clauses ■ (P(john), Q(fred), R(X)) ■ (¬P(Y), R(susan), R(Y)) Be resolved?

3 Hojjat Ghaderi, University of Toronto, Fall 2006 Unification. ● Intuitively, once reduced to clausal form, all remaining variables are universally quantified. So, implicitly (¬P(Y), R(susan), R(Y)) represents clauses like ■ (¬P(fred), R(susan), R(fred)) ■ (¬P(john), R(susan), R(john)) ■ … ● So there is a “specialization” of this clause that can be resolved with (P(john), Q(fred), R(X)

4 Hojjat Ghaderi, University of Toronto, Fall 2006 Unification. ● We want to be able to match conflicting literals, even when they have variables. This matching process automatically determines whether or not there is a “specialization” that matches. ● We don’t want to over specialize!

5 Hojjat Ghaderi, University of Toronto, Fall 2006 Unification. ● (¬p(X), s(X), q(fred)) ● (p(Y), r(Y)) ● Possible resolvants ■ (s(john), q(fred), r(john)) {Y=X, X=john} ■ (s(sally), q(fred), r(sally)) {Y=X, X=sally} ■ (s(X), q(fred), r(X)) {Y=X} ● The last resolvant is “most-general”, the other two are specializations of it. ● We want to keep the most general clause so that we can use it future resolution steps.

6 Hojjat Ghaderi, University of Toronto, Fall 2006 Unification. ● unification is a mechanism for finding a “most general” matching. ● First we consider substitutions. ■ A substitution is a finite set of equations of the form (V = t) where V is a variable and t is a term not containing V. (t might contain other variables).

7 Hojjat Ghaderi, University of Toronto, Fall 2006 Substitutions. ● We can apply a substitution  to a formula f to obtain a new formula f  by simultaneously replacing every variable mentioned in the left hand side of the substitution by the right hand side. p(X,g(Y,Z))[X=Y, Y=f(a)]  p(Y,g(f(a),Z)) ● Note that the substitutions are not applied sequentially, i.e., the first Y is not subsequently replaced by f(a).

8 Hojjat Ghaderi, University of Toronto, Fall 2006 Substitutions. ● We can compose two substitutions.  and  to obtain a new substition . Let  = {X 1 =s 1, X 2 =s 2, …, X m =s m }  = {Y 1 =t 1, Y 2 =t 2, …, Y k =s k } To compute  1. S = {X 1 =s 1 , X 2 =s 2 , …, X m =s m , Y 1 =t 1, Y 2 =t 2,…, Y k =s k } we apply  to each RHS of  and then add all of the equations of .

9 Hojjat Ghaderi, University of Toronto, Fall 2006 Substitutions. 1. S = {X 1 =s 1 , X 2 =s 2 , …, X m =s m , Y 1 =t 1, Y 2 =t 2,…, Y k =s k } 2. Delete any identities, i.e., equations of the form V=V. 3. Delete any equation Y i =s i where Y i is equal to one of the X j in . The final set S is the composition .

10 Hojjat Ghaderi, University of Toronto, Fall 2006 Composition Example.  = {X=f(Y), Y=Z},  = {X=a, Y=b, Z=Y} 

11 Hojjat Ghaderi, University of Toronto, Fall 2006 Substitutions. ● The empty substitution  = {} is also a substitution, and it acts as an identity under composition. ● More importantly substitutions when applied to formulas are associative: (f  )  = f(  ) ● Composition is simply a way of converting the sequential application of a series of substitutions to a single simultaneous substitution.

12 Hojjat Ghaderi, University of Toronto, Fall 2006 Unifiers. ● A unifier of two formulas f and g is a substitution  that makes f and g syntactically identical. ● Not all formulas can be unified— substitutions only affect variables. p(f(X),a) p(Y,f(w)) ● This pair cannot be unified as there is no way of making a = f(w) with a substitution.

13 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU. ● A substitution  of two formulas f and g is a Most General Unifier (MGU) if 1.  is a unifier. 2. For every other unifier  of f and g there must exist a third substitution such that  =   This says that every other unifier is “more specialized than . The MGU of a pair of formulas f and g is unique up to renaming.

14 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU. p(f(X),Z) p(Y,a) 1.  = {Y = f(a), X=a, Z=a} is a unifier. p(f(X),Z)  = p(Y,a)  =  But it is not an MGU. 2.  = {Y=f(X), Z=a} is an MGU. p(f(X),Z)  = p(Y,a)  =

15 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU. p(f(X),Z) p(Y,a)   = , where ={X=a}  {Y = f(a), X=a, Z=a}  ={X=a}  =

16 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU. ● The MGU is the “least specialized” way of making clauses with universal variables match. ● We can compute MGUs. ● Intuitively we line up the two formulas and find the first sub-expression where they disagree. The pair of subexpressions where they first disagree is called the disagreement set. ● The algorithm works by successively fixing disagreement sets until the two formulas become syntactically identical.

17 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU. To find the MGU of two formulas f and g. 1. k = 0;  0 = {}; S 0 = {f,g} 2. If S k contains an identical pair of formulas stop, and return  k as the MGU of f and g. 3. Else find the disagreement set D k ={e 1,e 2 } of S k 4. If e 1 = V a variable, and e 2 = t a term not containing V (or vice-versa) then let  k+1 =  k {V=t} (Compose the additional substitution) S k+1 = S k {V=t} (Apply the additional substitution) k = k+1 GOTO 2 5. Else stop, f and g cannot be unified.

18 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU Example 1. S_0 = {p(f(a), g(X)) ; p(Y,Y)}

19 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU Example 2. S 0 = {p(a,X,h(g(Z))) ; p(Z,h(Y),h(Y))}

20 Hojjat Ghaderi, University of Toronto, Fall 2006 MGU Example 3. S 0 = {p(X,X) ; p(Y,f(Y))}

21 Hojjat Ghaderi, University of Toronto, Fall 2006 Non-Ground Resolution ● Resolution of non-ground clauses. From the two clauses (L, Q1, Q2, …, Qk) (¬M, R1, R2, …, Rn) Where there exists  a MGU for L and M. We infer the new clause (Q1 , …, Qk , R1 , …, Rn  )

22 Hojjat Ghaderi, University of Toronto, Fall 2006 Non-Ground Resolution E.G. 1. (p(X), q(g(X))) 2. (r(a), q(Z),  p(a)) L=p(X); M=p(a)  = {X=a} 3. R[1a,2c]{X=a} (q(g(a)), r(a), q(Z)) The notation is important. ● “R” means resolution step. ● “1a” means the first (a-th) literal in the first clause i.e. p(X). ● “2c” means the third (c-th) literal in the second clause,  p(a). ■ 1a and 2c are the “clashing” literals. ● {X=a} is the substitution applied to make the clashing literals identical.

23 Hojjat Ghaderi, University of Toronto, Fall 2006 Resolution Proof Example “Some patients like all doctors. No patient likes any quack. Therefore no doctor is a quack.” Resolution Proof Step 1. Pick symbols to represent these assertions. p(X): X is a patient d(x): X is a doctor q(X): X is a quack l(X,Y): X likes Y

24 Hojjat Ghaderi, University of Toronto, Fall 2006 Resolution Proof Example Resolution Proof Step 2. Convert each assertion to a first-order formula. 1. Some patients like all doctors. F1.

25 Hojjat Ghaderi, University of Toronto, Fall 2006 Resolution Proof Example 2. No patient likes any quack F2. 3. Therefore no doctor is a quack. Query.

26 Hojjat Ghaderi, University of Toronto, Fall 2006 Resolution Proof Example Resolution Proof Step 3. Convert to Clausal form. F1. F2. Negation of Query.

27 Hojjat Ghaderi, University of Toronto, Fall 2006 Resolution Proof Example Resolution Proof Step 4. Resolution Proof from the Clauses. 1. p(a) 2. (  d(Y), l(a,Y)) 3. (  p(Z),  q(R),  l(Z,R)) 4. d(b) 5. q(b)

28 Hojjat Ghaderi, University of Toronto, Fall 2006 Resolution Proof Example