All rights reservedL. Manevitz Lecture 51 Artificial Intelligence Logic Part 2 L. Manevitz.

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

Resolution Proof System for First Order Logic
Biointelligence Lab School of Computer Sci. & Eng.
SLD-resolution Introduction Most general unifiers SLD-resolution
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.
Standard Logical Equivalences
Artificial Intelligence University Politehnica of Bucharest Adina Magda Florea
Logic-Based Systems AI Lecture Prof. Carolina Ruiz Worcester Polytechnic Institute.
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.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Resolution in Propositional and First-Order Logic.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Logic seminar 5 The resolution principle Slobodan Petrović.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
All rights reservedL. Manevitz Lecture 41 Artificial Intelligence Logic L. Manevitz.
Inference and Resolution for Problem Solving
Artificial Intelligence
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.
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
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.
CSCE 4613 Artificial Inteligence
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.
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,
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.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 17 Wednesday, 01 October.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
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.
Natural Deduction for Predicate Logic Bound Variable: A variable within the scope of a quantifier. – (x) Px – (  y) (Zy · Uy) – (z) (Mz  ~Nz) Free Variable:
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.
Resolution Proofs  Requires axioms to be in clause form  To do harder proofs, we convert their axioms to clause form  Clause form is a disjunctions.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
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)
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.
Examples of Predicate Logic Proofs. Example 1 Argument: ( ∀ x ∈ D, P(x)) ˅ ( ∃ y ∈ D, Q(y)) ∃ z ∈ D, ~P(z) ∃ w ∈ D, Q(w)
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 Hojjat Ghaderi, University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Knowledge Representation III ● Required Readings: 9.1, 9.2,
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.
CS589 Principles of DB Systems Fall 2008 Lecture 4c: Query Language Equivalence Lois Delcambre
3. The Logic of Quantified Statements Summary
CSE 341, S. Tanimoto Logic Programming -
Resolution in the Propositional Calculus
Horn Clauses and Unification
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Soundness of SLD-Resolution
Horn Clauses and Unification
Horn Clauses and Unification
CSE (c) S. Tanimoto, 2004 Unification
CSE S. Tanimoto Unification
Biointelligence Lab School of Computer Sci. & Eng.
CSE (c) S. Tanimoto, 2002 Unification
Encoding Knowledge with First Order Predicate Logic
Encoding Knowledge with First Order Predicate Logic
Encoding Knowledge with First Order Predicate Logic
Resolution Proof System for First Order Logic
Soundness of SLD-Resolution
Logical Inference 4 wrap up
Presentation transcript:

All rights reservedL. Manevitz Lecture 51 Artificial Intelligence Logic Part 2 L. Manevitz

All rights reservedL. Manevitz Lecture 52 Unification Alphabetic variant. Term substitution. “Ground”. P(x,f(y),B) S 1 ={z/x,w/y} S 2 ={g(z)/x,A/y} S 3 ={C/x,A/y} P(z,f(w),B) P(g(z),f(A),B) P(C,f(A),B)

All rights reservedL. Manevitz Lecture 53 Example x [P(x) Q(x)] P(a) Q(a) x [ P(x) Q(x)] P(x) Q(x) P(a) Q(a) P(a) Q(a) Substitution

All rights reservedL. Manevitz Lecture 54 Unification cont. m.g.ug: s s’ {Ei}s = {Ei}g s’ {A(x),A(z)} {A(a)}{A(x)} S 1 ={a/x,a/z } S 2 ={x/z} {Ei} S 1 = {Ei}g S 2

All rights reservedL. Manevitz Lecture 55 Example of m.g.u {P(x),P(A)} {P[f(x),y,g(y)],P[f(x),x,g(z)]} {P[f(x,g(A,y)),g(A,y)],P[f(x,z),z]} P(A) P[f(x),x,g(x)] P[f(x,g(A,y)),g(A,y)]

All rights reservedL. Manevitz Lecture 56 Unification – Algorithm Unify(E 1,E 2 ) If E 1 or E 2 is an atom (that is, a predicate symbol, a function symbol, a constant symbol, a negation symbol or a variable), interchange the arguments E 1 and E 2 (if necessary) so that E 1 is an atom, and do:

All rights reservedL. Manevitz Lecture 57 Unification – Algorithm cont. 2.Begin: 1.If E 1 and E 2 are identical, return NIL. 2.If E 1 is a variable, do: 3.Begin: 2.If E 1 occurs in E 2, return FAIL. 3.Return {E 2 / E 1 }. 4.End. 5.If E 2 is a variable, return {E 1 / E 2 }. 6.Return FAIL. 3.End.

All rights reservedL. Manevitz Lecture 58 Unification – Algorithm cont. 4.F 1  the first element of E 1, T 1  the rest of E 1. 5.F 2  the first element of E 2, T 2  the rest of E 2. 6.Z 1  UNIFY(F 1,F 2 ). 7.If Z 1 = FAIL, return FAIL.

All rights reservedL. Manevitz Lecture 59 Unification – Algorithm cont. 8.G 1  result of applying Z 1 to T 1. 9.G 2  result of applying Z 1 to T Z 2  UNIFY(G 1,G 2 ). 11.If Z 2 = FAIL, return FAIL. 12.Return the composition of Z 1 and Z 2.

All rights reservedL. Manevitz Lecture 510 4Trace of Unification Unify ((fxx), (fAy)) –4. F1 = f; T1 = (xx) ; F2 = f; T2 =(Ay) –6. Unify (f, f) 1. f = f so return NIL 8. G1 = NIL(T1) = (xx) G2 = (Ay) 10. Unify ((xx, Ay) 4. F1 = x F2 = A etc 6. Unify (x, A) 3.3 Return A/x 8. Apply A/x to (x) (y) get (A y) 10. Unify (A, y) get A/y Return composition of A/x and A/y Result is fAA.

All rights reservedL. Manevitz Lecture 511 Example 1.Whoever can read is literate. 2.Dolphins are not literate. 3.Some dolphins are intelligent. x [R(x) L(x)] x [D(x) L(x)] x [D(x) I(x)]

All rights reservedL. Manevitz Lecture 512 Example cont. To prove: some who are intelligent can not read. x [I(x) R(x)]

All rights reservedL. Manevitz Lecture 513 Example cont. Clause Form: 1.R(x) L(x) 2.D(y) L(y) 3.Divided to two:A is Skolem constant 1.D(A) 2.I(A) 4.Negation of theory: I(z) R(z)

All rights reservedL. Manevitz Lecture 514 Example cont. I(z) R(z) I(A)R(A) R(x) L(x) L(A) D(y) L(y) D(A) NIL

All rights reservedL. Manevitz Lecture 515 Control Methods Breadth First. Set of Support. Linear Input.

All rights reservedL. Manevitz Lecture 516 Breadth First - Example I(z) R(z) I(A)R(A) R(x) L(x) L(A) D(y) L(y) L(A)D(A) NIL I(z) L(z) R(y) D(y) I(A) R(A) I(z) D(z) D(A)L(A)

All rights reservedL. Manevitz Lecture 517 Set of Support - Example I(z) R(z) I(A)R(A) R(x) L(x) L(A) D(y) L(y) D(A) I(A) I(y) D(y) D(A)L(A) D(A) I(z) L(z)

All rights reservedL. Manevitz Lecture 518 Linear Input - Example I(A)R(A) R(x) L(x) L(A) D(y) L(y) D(A) I(A) I(y) D(y) L(A) R(A) I(z) L(z) I(z) R(z) R(y) D(y) I(z) D(z) L(A)

All rights reservedL. Manevitz Lecture 519 A refutation tree (note: no linear input tree) Q(x) P(x) Q(y) P(y) Q(w) P(w) P(A) P(x) Q(w) NIL Q(u) P(A)

All rights reservedL. Manevitz Lecture 520 Ancestor Filtered Like linear input but also … Additional resolutions where one parent is the ancestor of the other one. Surprisingly, this is a complete strategy

All rights reservedL. Manevitz Lecture 521 A refutation tree (note: no linear input tree) Q(x) P(x) Q(y) P(y) Q(w) P(w) P(A) P(x) Q(w) NIL Q(u) P(A)

All rights reservedL. Manevitz Lecture 522 Example no.1 x [AT(JOHN,x) AT(FIDO,x)] AT(JOHN,School) Where is FIDO ? x [AT(FIDO,x)] AT(FIDO,x)

All rights reservedL. Manevitz Lecture 523 Example no.1 cont. Answer: Append negation of each clause that arises from negation of theorem to each leaf in derivation tree in which it appears. Follow structure of derivation tree. Use clause at root as answer.

All rights reservedL. Manevitz Lecture 524 Example no.1 cont. AT(FIDO,x) Negation of Goal AT(JOHN,y) AT(FIDO,y) Axiom 1 NIL AT(JOHN,x) AT(JOHN,SCHOOL) Axiom 2 y x x SCHOOL

All rights reservedL. Manevitz Lecture 525 Example no.1-Green’s Trick AT(JOHN,y) AT(FIDO,y) AT(FIDO,SCHOOL) AT(JOHN,SCHOOL) y x x SCHOOL AT(FIDO,x) AT(JOHN,x) AT(FIDO,x)

All rights reservedL. Manevitz Lecture 526 Example no.2 On (B,A) On (A,Table) T.S. Above (B,Table) The axioms : x y[On(x,y) Above(x,y)] x y z[Above(x,y) Above(y,z) Above(x,z)]

All rights reservedL. Manevitz Lecture 527 Example no.2 cont. Clause form: 1.On(u,v) Above(u,v) 2.Above(x,y) Above(y,z) Above(x,z) 3.On(B,A) 4.On(A,Table) 5.Above(B,Table)

All rights reservedL. Manevitz Lecture 528 Example no.2 – Resolution Above(B,y) Above(y,Table)On(y,Table) Above(B,y)On(B,y) On(y,Table) On(A,Table) NIL

All rights reservedL. Manevitz Lecture 529 Example no.3 Predicates: On(A,Table) On(B,A) Function: PutonTable? x On(x,Table) How to use the function? Need to add situation parameter

All rights reservedL. Manevitz Lecture 530 Frame Problem A B BA Operator: PutonTable(x): If x not on table, it puts x on table. How should we represent this in logic ?

All rights reservedL. Manevitz Lecture 531 Making Situation Part of Logic S0 – initial situation. On(A,Table,S0) On(B,A,S0) PutonTable axiom: z x [ On(x,Table,z) On(x,Table,PutonTable(x,z)] (PutonTable is function P:Object X Situation Situation)

All rights reservedL. Manevitz Lecture 532 Making Situation Part of Logic Other axioms (how do we find them ?) x y z [On(x,y,z) On(y,x,z)] A = B A = Table B = Table

All rights reservedL. Manevitz Lecture 533 Frame Problem cont. When will B be on the Table? Apply Green’s Trick Goal: z On(B,Table,z) z On(B,Table,z) Axioms: On(B,A,S 0 ) On(A,Table,S 0 ) z x[ On(x,Table,z) On(x,Table,PutonTable(x,z))] z y x[On(y,x,z) x=Table On(y,Table,z)] x y z[On(y,x,z) On(x,y,z)] negated

All rights reservedL. Manevitz Lecture 534 Frame Problem cont. Clause form: 1.On(B,A,S 0 ) 2.On(A,Table,S 0 ) 3.On(x,Table, S 3 ) On(x,Table,PutonTable(x,S 3 )) 4.On(y,z,S 4 ) z=Table On(y,Table,S 4 ) 5.(A=B) 6.(B=Table) 7.(A=Table) 8.On(u,v,w) On(v,u,w) 9.On(B,Table,s) Goal Formula

All rights reservedL. Manevitz Lecture 535 On(x,Table, S 3 ) On(x,Table,PutonTable(x,S 3 )) On(B,Table,S) On(B,Table, S 3 ) On(B,z,S 3 ) z=Table (A=Table) On(B,A,S 3 ) NIL 93 On(y,z,S 4 ) z=Table On(y,Table,S 4 ) 4 7 On(B,A,S 0 ) 1 x B y BS 4 S 3 z A S 3 S 0 S PutonTable(B,S3) Green’s Trick On(B,Table,S) On(B,Table, PutonTable(B,S 3 )) On(B,Table, PutonTable(B,S0)) On(B,Table, PutonTable(B,S 3 ))

All rights reservedL. Manevitz Lecture 536 Frame Problem cont. Do we know a state where both A and B on table? Goal: s[On(B,Table,s) On(A,Table,s)] Negate + Clause: On(B,Table,s) On(A,Table,s) New formula no.9

All rights reservedL. Manevitz Lecture 537 Slide Missing on Start of Proof of A and B on table Show where you get stuck

All rights reservedL. Manevitz Lecture 538 Frame Problem cont. The knowledge that A stays put wasn’t put into logic ! Needs a “frame axiom” : s x y z[On(x,y,s) x=z On(x,y,PutonTable(z,s))] Clause form: On(p,q,t) p=r On(p,q,PutonTable(r,t)) Formula no.10

All rights reservedL. Manevitz Lecture 539 On(p,q,t) p=r On(p,q,PutonTable(r,t)) On(A,Table,S 0 ) A=B (A=B) On(A,Table,S 0 ) NIL 10 5 On(A,Table,S 0 ) 2 p Ar B t S 0 On(A,Table, PutonTable(B,S 0 )) 9 q Table