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.

Slides:



Advertisements
Similar presentations
Inference in First-Order Logic
Advertisements

Artificial Intelligence 8. The Resolution Method
Some Prolog Prolog is a logic programming language
First-Order Logic.
Inference Rules Universal Instantiation Existential Generalization
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: – Constant symbols (i.e., the "individuals"
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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.
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.
Logic Use mathematical deduction to derive new knowledge.
Horn Form A sentence is in Horn form if and only if ….
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Resolution Theorem Proving
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Resolution in Propositional and First-Order Logic.
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.
RESOLUTION: A COMPLETE INFERENCE PROCEDURE. I Then we certainly want to be able to conclude S(A); S(A) is true if S(A) or R(A) is true, and one of those.
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.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
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
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Inference in First-Order Logic
Artificial Intelligence
Prop logic First order predicate logic (FOPC) Prob. Prop. logic Objects, relations Degree of belief First order Prob. logic Objects, relations.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Start with atomic sentences in the KB and apply Modus Ponens, adding new atomic sentences, until “done”.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
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.
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.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
1 Chapter 8 Inference and Resolution for Problem Solving.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 15 of 41 Friday 24 September.
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
Reasoning using First-Order Logic
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Propositional Logic Resolution
Logical Inference: Through Proof to Truth
Logic Use mathematical deduction to derive new knowledge.
Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
CS 416 Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
Methods of Proof Chapter 7, second half.
RESOLUTION.
Presentation transcript:

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 are some facts that we cannot prove using GMP Suppose we have in our KB GoToSchool(Joe)  GoToSchool(Sue)  GoToSchool(Joe)  GoToSchool(Sue) And we want to know if GoToSchool(Sue) Although humans can look at such a KB and immediately see that GoToSchool(Sue) is true, GMP cannot entail that fact!! So GMP is not complete.

Is there any complete inference procedure for FOL? Yes! It is called resolution refutation (or just resolution). It is complete. It is sound. It is optimally efficient. It works for KB in any format unlike GMP which only works for KBs in Horn clause format (although we generally have to reorganize the format).

Suppose you know that you are going to fail or pass CS 170. Further, since this is the only class you need to graduate, you know that you are going to either not pass the class or graduate on time. Then you can derive the fact that you will either not pass or you graduate on time. Fail or Pass, not Pass or GraduateOnTime Therefore Fail or GraduateOnTime FFail PPass GGraduate on time F  P,  P  G F  G

An intuitive look at why resolution works. In general we know that A  B is equivalent to  A  B So I could rewrite AB AA  A  BA  B True FalseTrue False True False True A  B,  B  C |- A  C as  A  B,  B  C |- A  C  (  A)  B,  B  C |- A  C  (  A)  B,  B  C |-  A  C  A  B, B  C |-  A  C This is very intuitive! If not  A implies B, and B implies C, then surely  A also implies C. Not raining implies sunny, sunny implies go to the beach, therefore not raining implies go to the beach.

Suppose our KB consists the following sentences P  Q  P  R  Q  R And the goal is to prove R  S We negate the goal, so R  S becomes  (R  S)  R   S (by De Morgan’s law)  R,  S (And-Elimination) Now we add  R,  S to our knowledge base and look for a contradiction. How resolution refutation works I P  Q  P  R  Q  R  R  S

How resolution refutation works II P  Q  P  R  Q  R  R  S Q  P  P  R Q  R P  Q  Q  R R RR R   R Contradiction! That's all there is to resolution for propositional logic, for first order logic we just have to put the KB in the right format, otherwise it works the same.

SUBST{y/w} SUBST{w/x} SUBST{x/A, z/A} In order for resolution to work for FOL, the KB must be in Conjunctive Normal Form (CNF) Conjunctive Normal Form: The KB is a conjunction of disjunctions We will address the problem of translating an arbitrary KB into CNF in the next few slides.  P(w)  Q(w) P(x)  R(x)  Q(y)  S(y)  R(z)  S(z)  P(w)  Q(w)  Q(y)  S(y) The Goal is S(A), so negate it and add it to the KB  P(w)  S(w) S(w)   P(w) P(x)  R(x) S(x)  R(x)  R(z)  S(z) S(A)  S(A) S(A)   S(A)  P(w)  Q(w) P(x)  R(x)  Q(y)  S(y)  R(z)  S(z)  S(A) Now lets look for a contradiction… Contradiction!

We have seen that we can do resolution when the KB is in CNF. But most KB are not is that format. Theorem: We can convert any KB to CNF Eliminate Implications Move  inwards Standardize Variables Move Quantifiers left Skolemize {Eliminate Existential Quantifiers, Drop Universal Quantifiers } Distribute  over  Flatten nested conjunctions and disjunctions. Note that we must do the steps in order!

Eliminate Implications Change all implication sentences to disjunctions So A  B becomes  A  B C   D becomes  C   D etc

Move  inwards Negation is only allow on atom, not whole sentences. So  ( A  B) becomes  A   B  (A  B) becomes  A   B  x P becomes  x  P   x P becomes  x  P  Pbecomes P

Standardize Variables Make sure that you are not using the same variable name twice in a single sentence (unless you really meant to). So(  x P(x) )  (  x Q(x) ) becomes (  x P(x) )  (  z Q(z) )

Move Quantifiers left Move all quantifiers left, but keep them in order! So  x P(x)   y Q(y) becomes  x  y P(x)  Q(y)

Skolemize {Eliminate Existential Quantifiers, Drop Universal Quantifiers } Existential quantifiers can be eliminated by the introduction of a new constant that does not appear elsewhere in the database.  x P(x)  Q(x) becomes P(A)  Q(A) SUBST{x/A} One possible complication occurs if we also have Universal quantifiers… Consider  xperson(x)   y heart(y)  has(x,y) Becomes by SUBST{y/H}  xperson(x)  heart(H)  has(x,H)!!! Instead we have to create a new (Skolem) function to map from a person to their heart F(x)  xperson(x)  heart(F(x))  has(x,F(x)) Drop Universal Quantifiers

Distribute  over  (A  B)  C becomes (A  C)  (A  B) Just like distribution in arithmetic (5 + 4) * 6 becomes (5 * 6 ) + (4 * 6 )

Flatten nested conjunctions and disjunctions. (A  B)  C becomes (A  B  C) (A  B)  Cbecomes (A  B  C)

Done!! Eliminate Implications Move  inwards Standardize Variables Move Quantifiers left Skolemize {Eliminate Existential Quantifiers, Drop Universal Quantifiers } Distribute  over  Flatten nested conjunctions and disjunctions. Once we have done all the above steps, our KB is in CNF. We can now do resolution refutation. There is still an element of search, we have to decide which pairs of sentences to resolve, and which substitutions we should use. The goal is simply to find a contradiction. There are many heuristics for the search (Our textbook lists Unit preference, Set of support, Input resolution )

Bad News Even with all the heuristics resolution is exponential in general. Resolution is complete, but only semidecidable. If our KB implies A (or it implies  A), resolution will find the proof in finite time. But if the KB does not implies A (or  A), resolution will simply run forever.