Automated Reasoning in Propositional Logic Russell and Norvig: Chapters 6 and 9 Chapter 7, Sections 7.5—7.6 CS121 – Winter 2003.

Slides:



Advertisements
Similar presentations
Russell and Norvig Chapter 7
Advertisements

UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Logical Inference 1 introduction Chapter 9 Some material adopted from notes by Andreas Geyer-Schulz,, Chuck Dyer, and Mary Getoor.
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.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Midterm Review CMSC421 – Fall CH1 Summary: Intro AI Definitions: dimensions human/rational think/act Three Major Components of AI Algorithms Representation.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Chapter 3 Propositional Logic
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Logical Inference 3 resolution
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.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Logical Agents Logic Propositional Logic Summary
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
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.:
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
1 Logical Inference Algorithms CS 171/271 (Chapter 7, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material.
CS6133 Software Specification and Verification
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
Automated Reasoning in Propositional Logic Problem Given: KB: a set of sentence  : a sentence Answer: KB  ?
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Inference in Propositional Logic (and Intro to SAT)
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
Logical Inference 1 introduction
Knowledge Representation and Reasoning
EA C461 – Artificial Intelligence Logical Agent
Resolution in the Propositional Calculus
Biointelligence Lab School of Computer Sci. & Eng.
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Back to “Serious” Topics…
Biointelligence Lab School of Computer Sci. & Eng.
Automated Reasoning in Propositional Logic
Methods of Proof Chapter 7, second half.
Presentation transcript:

Automated Reasoning in Propositional Logic Russell and Norvig: Chapters 6 and 9 Chapter 7, Sections 7.5—7.6 CS121 – Winter 2003

Automated Reasoning in Propositional Logic2 Problem Given: KB: a set of sentence  : a sentence Answer: KB  ?

Automated Reasoning in Propositional Logic3 KB  iff {KB,  } is unsatisfiable Deduction vs. Satisfiability Test Hence: Deciding whether a set of sentences entails another sentence, or not Testing whether a set of sentences is satisfiable, or not are closely related problems

Automated Reasoning in Propositional Logic4 Computational Approaches Enumeration of models Construction of a proof 1. Battery-OK  Bulbs-OK  Headlights-Work 2. Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts 3. Engine-Starts   Flat-Tire  Car-OK 4. Headlights-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9. Battery-OK  Starter-OK  (5+6) 10. Battery-OK  Starter-OK   Empty-Gas-Tank  (9+7) 11. Engine-Starts  (2+10) 12.  Engine-Starts  Flat-Tire  (3+8) 13. Flat-Tire  (11+12)

Automated Reasoning in Propositional Logic5 Enumeration of Models P : Set of propositional symbols in {KB,  } n: Size of P ENTAILS?( KB,  ) For each of the 2 n models on P do If it is a model of {KB,  } then return no Return yes

Automated Reasoning in Propositional Logic6 Satisfiability Test as CSP Each propositional symbol is a variable The domain of each variable is {True, False} Each sentence in {KB,  } is a constraint on the value(s) taken by one or several variables Recursive backtracking CSP techniques and heuristics are applicable

Automated Reasoning in Propositional Logic7 Construction of a Proof 1. Battery-OK  Bulbs-OK  Headlights-Work 2. Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts 3. Engine-Starts   Flat-Tire  Car-OK 4. Headlights-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9. Battery-OK  Starter-OK  (5+6) 10. Battery-OK  Starter-OK   Empty-Gas-Tank  (9+7) 11. Engine-Starts  (2+10) 12.  Engine-Starts  Flat-Tire  (3+8) 13. Flat-Tire  (11+12)

Automated Reasoning in Propositional Logic8 Construction of a Proof 1. Battery-OK  Bulbs-OK  Headlights-Work 2. Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts 3. Engine-Starts   Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9. Battery-OK  Starter-OK  (5+6) 10. Battery-OK  Starter-OK   Empty-Gas-Tank  (9+7) 11. Engine-Starts  (2+10) 12.  Engine-Starts  Flat-Tire  (3+8) 13. Flat-Tire  (11+12) What do we need? A complete set of sound inference rules A complete search algorithm to decide which rule to apply next and to which sentences

Automated Reasoning in Propositional Logic9 Complementary Literals A literal is a either an atomic sentence or the negated atomic sentence, e.g.: P or  P Two literals are complementary if one is the negation of the other, e.g.: P and  P

Automated Reasoning in Propositional Logic10 Unit Resolution Rule Given two sentences: L 1  …  L p and M where L i,…, L p and M are all literals, and M and L i are complementary literals Infer: L 1  …  L i-1  L i+1  …  L p

Automated Reasoning in Propositional Logic11 Examples From:  Engine-Starts  Car-OK Engine-Starts Infer: Car-OK From:  Engine-Starts  Car-OK  Car-OK Infer:  Engine-Starts Modus ponens Modus tolens Engine-Starts  Car-OK

Automated Reasoning in Propositional Logic12 Another Example 1.  Engine-Starts  Flat-Tire  Car-OK 2. Engine-Starts 3.  Flat-Tire 4. Flat-Tire  Car-OK 5. Car-OK

Automated Reasoning in Propositional Logic13 Detection of Unsatisfiability 1.Car-OK 2.  Car-OK 3.False

Automated Reasoning in Propositional Logic14 Soundness of Unit Resolution Let m be a model of: L 1  …  L p and M where M and L i are complementary literals L i must be False in m, hence L 1  …  L i-1  L i+1  …  L p must be True

Automated Reasoning in Propositional Logic15 Shortcoming of Unit Resolution From:   Engine-Starts  Flat-Tire  Car-OK  Engine-Starts  Empty-Gas-Tank we can infer nothing!

Automated Reasoning in Propositional Logic16 Full Resolution Rule Given two sentences: L 1  …  L p and M 1  …  M q where L 1,…, L p, M 1,…, M q are all literals, and L i and M j are complementary literals Infer: L 1  …  L i-1  L i+1  …  L k  M 1  …  M j-1  M j+1  …  M k in which only one copy of each literal is retained (factoring)

Automated Reasoning in Propositional Logic17 Example From:  Engine-Starts  Flat-Tire  Car-OK Engine-Starts  Empty-Gas-Tank Infer: Empty-Gas-Tank  Flat-Tire  Car-OK

Automated Reasoning in Propositional Logic18 Example From:  P  Q (  P  Q)  Q  R (  Q  R) Infer:  P  R (  P  R)

Automated Reasoning in Propositional Logic19 Not All Inferences are Useful! From:  Engine-Starts  Flat-Tire  Car-OK Engine-Starts   Flat-Tire Infer:  Flat-Tire  Flat-Tire  Car-OK

Automated Reasoning in Propositional Logic20 Not All Inferences are Useful! From:  Engine-Starts  Flat-Tire  Car-OK Engine-Starts   Flat-Tire Infer:  Flat-Tire  Flat-Tire  Car-OK tautology

Automated Reasoning in Propositional Logic21 Not All Inferences are Useful! From:  Engine-Starts  Flat-Tire  Car-OK Engine-Starts   Flat-Tire Infer:  Flat-Tire  Flat-Tire  Car-OK  True tautology

Automated Reasoning in Propositional Logic22 Soundness of Full Resolution Left as an exercise

Automated Reasoning in Propositional Logic23 Full Resolution Rule Given two sentences: L 1  …  L p and M 1  …  M q Infer: L 1  …  L i-1  L i+1  …  L k  M 1  …  M j-1  M j+1  …  M k clauses

Automated Reasoning in Propositional Logic24 Sentence  Clause Form Example: (A   B)  (C  D)

Automated Reasoning in Propositional Logic25 Sentence  Clause Form Example: (A   B)  (C  D) 1. Eliminate   (A   B)  (C  D)

Automated Reasoning in Propositional Logic26 Sentence  Clause Form Example: (A   B)  (C  D) 1. Eliminate   (A   B)  (C  D) 2. Reduce scope of  (  A  B)  (C  D)

Automated Reasoning in Propositional Logic27 Sentence  Clause Form Example: (A   B)  (C  D) 1. Eliminate   (A   B)  (C  D) 2. Reduce scope of  (  A  B)  (C  D) 3. Distribute  over  (  A  (C  D))  (B  (C  D)) (  A  C)  (  A  D)  (B  C)  (B  D)

Automated Reasoning in Propositional Logic28 Sentence  Clause Form Example: (A   B)  (C  D) 1. Eliminate   (A   B)  (C  D) 2. Reduce scope of  (  A  B)  (C  D) 3. Distribute  over  (  A  (C  D))  (B  (C  D)) (  A  C)  (  A  D)  (B  C)  (B  D) Set of clauses: {  A  C,  A  D, B  C, B  D}

Automated Reasoning in Propositional Logic29 Resolution Refutation Algorithm RESOLUTION-REFUTATION(KB  ) clauses  set of clauses obtained from KB and  new  {} Repeat: For each C, C’ in clauses do res  RESOLVE(C,C’) If res contains the empty clause then return yes new  new U res If new  clauses then return no clauses  clauses U new

Automated Reasoning in Propositional Logic30 Completeness of Resolution Refutation Left as an exercise

Automated Reasoning in Propositional Logic31 Example 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlights-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Starter-OK  Empty-Gas-Tank  Engine-Starts 11.  Battery-OK  Empty-Gas-Tank  Engine-Starts 12.  Battery-OK   Starter-OK  Engine-Starts 13.  Engine-Starts  Flat-Tire 14.  Engine-Starts  Car-OK

Automated Reasoning in Propositional Logic32 Example 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Starter-OK  Empty-Gas-Tank  Engine-Starts 11.  Battery-OK  Empty-Gas-Tank  Engine-Starts 12.  Battery-OK   Starter-OK  Engine-Starts 13.  Engine-Starts  Flat-Tire 14.  Engine-Starts  Car-OK

Automated Reasoning in Propositional Logic33 Example … Battery-OK Starter-OK  Empty-Gas-Tank  Car-OK  Flat-Tire …  Battery-OK   Starter-OK  Engine-Starts  Engine-Starts  Flat-Tire …

Automated Reasoning in Propositional Logic34 Example … Battery-OK Starter-OK  Empty-Gas-Tank  Car-OK  Flat-Tire …  Battery-OK   Starter-OK  Engine-Starts  Engine-Starts  Flat-Tire …  Battery-OK   Starter-OK  Flat-Tire …  Starter-OK  Flat-Tire … Flat-Tire … False (empty clause)

Automated Reasoning in Propositional Logic35 Resolution Heuristics Set-of-support heuristics: At least one ancestor of every inferred clause comes from  Shortest-clause heuristics: Generate a clause with the fewest literals first Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

Automated Reasoning in Propositional Logic36 Example (Set-of-Support) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire

Automated Reasoning in Propositional Logic37 Example (Set-of-Support) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Engine-Starts  Car-OK 11.  Engine-Starts 12.  Battery-OK   Starter-OK  Empty-Gas-Tank 13.  Starter-OK  Empty-Gas-Tank 14. Empty-Gas-Tank 15. False Note the goal-directed flavor

Automated Reasoning in Propositional Logic38 Resolution Heuristics Set-of-support heuristics: At least one ancestor of every inferred clause comes from  Shortest-clause heuristics: Generate a clause with the fewest literals first Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

Automated Reasoning in Propositional Logic39 Example (Shortest-Clause) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire

Automated Reasoning in Propositional Logic40 Example (Shortest-Clause) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlight-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire 10.  Engine-Starts  Car-OK 11.  Engine-Starts 12.  Bulbs-OK  Headlights-Work 13.  Battery-OK   Starter-OK  Empty-Gas-Tank 14.  Starter-OK  Empty-Gas-Tank 15. Empty-Gas-Tank 16. False

Automated Reasoning in Propositional Logic41 Resolution Heuristics Set-of-support heuristics: At least one ancestor of every inferred clause comes from  Shortest-clause heuristics: Generate a clause with the fewest literals first Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

Automated Reasoning in Propositional Logic42 Example (Pure Literal) 1.  Battery-OK   Bulbs-OK  Headlights-Work 2.  Battery-OK   Starter-OK  Empty-Gas-Tank  Engine-Starts 3.  Engine-Starts  Flat-Tire  Car-OK 4. Headlights-Work 5. Battery-OK 6. Starter-OK 7.  Empty-Gas-Tank 8.  Car-OK 9.  Flat-Tire

Automated Reasoning in Propositional Logic43 When to Use Logic? When the knowledge base is large and can be made explicit When formulating a problem as a CSP problem would yield complex constraints When the agent’s environment is conveniently described by true or false sentences

Automated Reasoning in Propositional Logic44 Summary Entailment problem Resolution rule Clause form of a set of sentences Resolution refutation algorithm Resolution heuristics