Using Predicate Logic Chapter 5.

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

Some Prolog Prolog is a logic programming language
First-Order Logic.
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.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 06 : First Order Logic Resolution Prove.
Standard Logical Equivalences
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
Artificial Intelligence
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.
Resolution
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Chapter 6 Logical Reasoning Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University
Automated reasoning and theorem proving Introduction: logic in AI Automated reasoning: ResolutionUnificationNormalization.
Predicate Logic Terms represent specific objects in the world and can be constants, variables or functions. Predicate Symbols refer to a particular relation.
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.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
CSE (c) S. Tanimoto, 2008 Propositional Logic
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
Propositional logic It represents real-world facts as logical propositions in well formed formulas. It presented as an atomic propositions, and complex.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
UBI517 Expert Systems 1 Lecture 2 Knowledge Representation.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Automated reasoning and theorem proving Introduction: logic in AI Automated reasoning: ResolutionUnificationNormalization.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
For Wednesday Read chapter 10 Prolog Handout 4. Exam 1 Monday Take home due at the exam.
SAT-solving Introduction: logic in AI SAT-solving techniques: Unit-propagationLocal-search.
UNIVERSITI TENAGA NASIONAL 1 CSNB234 ARTIFICIAL INTELLIGENCE Chapter 3 Propositional Logic & Predicate Logic Chapter 3 Propositional Logic & Predicate.
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.
Prolog IV Logic.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Logical Representations and Resolution. Boolean Logic Conjunctive normal form Resolution.
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
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.
1 Logic Programming Robert Kowalski’s equation: Algorithm = Logic + Control Definite logic program: A  B 1, B 2, …, B m (program clause) headbody  A.
Prolog Conversion to clause form Reference: Artificial Intelligence, by Elaine Rich and Kevin Knight.
Reasoning using First-Order Logic
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
1 Example: The following knowledge is given :The following knowledge is given : 1. Marcus was a man. 2. Marcus was a Pompeian. 3. All Pompeians were Romans.
CIT 856 – Artificial Intelligence
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
Chapter 3 Propositional calculus Predicate calculus Artificial Intelligence Dr.Hassan Al-Tarawneh.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Knowledge Representation
Automated reasoning and theorem proving
A I (Artificial Intelligence)
Predicate Logic Lecture 7.
Inference in First-Order Logic Chapter 9
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Artificial Intelligence
Prolog IV Logic, condensed.
Horn Clauses and Unification
Horn Clauses and Unification
Horn Clauses and Unification
CSNB234 ARTIFICIAL INTELLIGENCE
RESOLUTION.
Teorie assiomatico-deduttive (calcolo dei predicati)
Presentation transcript:

Using Predicate Logic Chapter 5

Using Propositional Logic Representing simple facts It is raining RAINING It is sunny SUNNY It is windy WINDY If it is raining, then it is not sunny RAINING  SUNNY

Using Propositional Logic Theorem proving is decidable Cannot represent objects and quantification

Using Predicate Logic Can represent objects and quantification Theorem proving is semi-decidable

Using Predicate Logic Marcus was a man. 2. Marcus was a Pompeian. 3. All Pompeians were Romans. 4. Caesar was a ruler. All Pompeians were either loyal to Caesar or hated him. 6. Every one is loyal to someone. People only try to assassinate rulers they are not loyal to. Marcus tried to assassinate Caesar.

Using Predicate Logic Marcus was a man. man(Marcus)

Using Predicate Logic 2. Marcus was a Pompeian. Pompeian(Marcus)

Using Predicate Logic 3. All Pompeians were Romans. x: Pompeian(x)  Roman(x)

Using Predicate Logic 4. Caesar was a ruler. ruler(Caesar)

Using Predicate Logic All Pompeians were either loyal to Caesar or hated him. inclusive-or x: Roman(x)  loyalto(x, Caesar)  hate(x, Caesar) exclusive-or x: Roman(x)  (loyalto(x, Caesar)  hate(x, Caesar))  (loyalto(x, Caesar)  hate(x, Caesar))

Using Predicate Logic 6. Every one is loyal to someone. x: y: loyalto(x, y) y: x: loyalto(x, y)

Using Predicate Logic People only try to assassinate rulers they are not loyal to. x: y: person(x)  ruler(y)  tryassassinate(x, y)  loyalto(x, y)

Using Predicate Logic Marcus tried to assassinate Caesar. tryassassinate(Marcus, Caesar)

Using Predicate Logic Was Marcus loyal to Caesar? man(Marcus) ruler(Caesar) tryassassinate(Marcus, Caesar)  x: man(x)  person(x) loyalto(Marcus, Caesar)

Using Predicate Logic Many English sentences are ambiguous. There is often a choice of how to represent knowledge. Obvious information may be necessary for reasoning We may not know in advance which statements to deduce (P or P).

Reasoning Is Marcus alive? 1. Marcus was a Pompeian. 2. All Pompeians died when the volcano erupted in 79 A.D. 3. It is now 2008 A.D. Is Marcus alive?

Reasoning Marcus was a Pompeian. Pompeian(Marcus) All Pompeians died when the volcano erupted in 79 A.D. erupted(volcano, 79)  x: Pompeian(x)  died(x, 79) 3. It is now 2008 A.D. now = 2008

x: t1: t2: died(x, t1)  greater-than(t2, t1)  dead(x, t2) Reasoning Marcus was a Pompeian. Pompeian(Marcus) All Pompeians died when the volcano erupted in 79 A.D. erupted(volcano, 79)  x: Pompeian(x)  died(x, 79) 3. It is now 2008 A.D. now = 2008 x: t1: t2: died(x, t1)  greater-than(t2, t1)  dead(x, t2)

Resolution Robinson, J.A. 1965. A machine-oriented logic based on the resolution principle. Journal of ACM 12 (1): 23-41.

Resolution The basic ideas KB |=   KB   |= false

Resolution The basic ideas KB |=   KB   |= false (  )  (  )  (  )

Resolution The basic ideas KB |=   KB   |= false (  )  (  )  (  ) sound and complete

Resolution in Propositional Logic 1. Convert all the propositions of KB to clause form (S). 2. Negate  and convert it to clause form. Add it to S. Repeat until either a contradiction is found or no progress can be made. Select two clauses (  P) and (  P). Add the resolvent (  ) to S.

Resolution in Propositional Logic Example: KB = {P, (P  Q)  R, (S  T)  Q, T}  = R

Resolution in Predicate Logic Example: KB = {P(a), x: (P(x)  Q(x))  R(x), y: (S(y)  T(y))  Q(y), T(a)}  = R(a)

Resolution in Predicate Logic Unification: UNIFY(p, q) = unifier  where SUBST(, p) = SUBST(, q)

Resolution in Predicate Logic Unification: x: knows(John, x)  hates(John, x) knows(John, Jane) y: knows(y, Leonid) y: knows(y, mother(y)) x: knows(x, Elizabeth) UNIFY(knows(John, x), knows(John, Jane)) = {Jane/x} UNIFY(knows(John, x), knows(y, Leonid)) = {Leonid/x, John/y} UNIFY(knows(John, x), knows(y, mother(y))) = {John/y, mother(John)/x} UNIFY(knows(John, x), knows(x, Elizabeth)) = FAIL

Resolution in Predicate Logic Unification: Standardization UNIFY(knows(John, x), knows(y, Elizabeth)) = {John/y, Elizabeth/x}

Resolution in Predicate Logic Unification: Most general unifier UNIFY(knows(John, x), knows(y, z)) = {John/y, John/x, John/z} = {John/y, Jane/x, Jane/z} = {John/y, v/x, v/z} = {John/y, z/x, Jane/v} = {John/y, z/x}

Resolution in Predicate Logic Unification: Occur check UNIFY(knows(x, x), knows(y, mother(y))) = FAIL

Conversion to Clause Form Eliminate . P  Q  P  Q Reduce the scope of each  to a single term. (P  Q)  P  Q (P  Q)  P  Q x: P  x: P x: p  x: P  P  P Standardize variables so that each quantifier binds a unique variable. (x: P(x))  (x: Q(x))  (x: P(x))  (y: Q(y))

Conversion to Clause Form Move all quantifiers to the left without changing their relative order. (x: P(x))  (y: Q(y))  x: y: (P(x)  (Q(y)) Eliminate  (Skolemization). x: P(x)  P(c) Skolem constant x: y P(x, y)  x: P(x, f(x)) Skolem function Drop . x: P(x)  P(x) Convert the formula into a conjunction of disjuncts. (P  Q)  R  (P  R)  (Q  R) 8. Create a separate clause corresponding to each conjunct. 9. Standardize apart the variables in the set of obtained clauses.

Conversion to Clause Form 1. Eliminate . 2. Reduce the scope of each  to a single term. Standardize variables so that each quantifier binds a unique variable. Move all quantifiers to the left without changing their relative order. Eliminate  (Skolemization). Drop . Convert the formula into a conjunction of disjuncts. Create a separate clause corresponding to each conjunct. Standardize apart the variables in the set of obtained clauses.

Example Marcus was a man. 2. Marcus was a Pompeian. 3. All Pompeians were Romans. 4. Caesar was a ruler. All Pompeians were either loyal to Caesar or hated him. 6. Every one is loyal to someone. People only try to assassinate rulers they are not loyal to. Marcus tried to assassinate Caesar.

Example Man(Marcus). 2. Pompeian(Marcus). 3. x: Pompeian(x)  Roman(x). 4. ruler(Caesar). x: Roman(x)  loyalto(x, Caesar)  hate(x, Caesar). x: y: loyalto(x, y). x: y: person(x)  ruler(y)  tryassassinate(x, y)  loyalto(x, y). 8. tryassassinate(Marcus, Caesar).

Example Prove: hate(Marcus, Caesar)

Question Answering When did Marcus die? Whom did Marcus hate? 3. Who tried to assassinate a ruler? 4. What happen in 79 A.D.?. 5. Did Marcus hate everyone?

Question Answering PROLOG: Only Horn sentences are acceptable

Question Answering PROLOG: Only Horn sentences are acceptable The occur-check is omitted from the unification: unsound test  P(x, x) P(x, f(x))

Question Answering PROLOG: Only Horn sentences are acceptable The occur-check is omitted from the unification: unsound test  P(x, x) P(x, f(x)) Backward chaining with depth-first search: incomplete P(x, y)  Q(x, y) P(x, x) Q(x, y)  Q(y, x)

Question Answering PROLOG: Unsafe cut: incomplete B  D, !, E A  B, C  A B  D, !, E D   B, C  D, !, E, C  !, E, C

Question Answering PROLOG: Unsafe cut: incomplete B  D, !, E A  B, C  A B  D, !, E D   B, C  D, !, E, C  !, E, C Negation as failure: P if fails to prove P

Homework Exercises 1-13, Chapter 5, Rich&Knight AI Text Book