Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4.

Slides:



Advertisements
Similar presentations
Russell and Norvig Chapter 7
Advertisements

1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
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.
3/30/00 Agents that Reason Logically by Chris Horn Jiansui Yang Xiaojing Wu.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
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.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Fall 2005.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
CS 460, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Computing & Information Sciences Kansas State University Lecture 11 of 42 CIS 530 / 730 Artificial Intelligence Lecture 11 of 42 William H. Hsu Department.
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 6 Dr Souham Meshoul CAP492.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge Representation I (Propositional Logic) CSE 473.
Cooperating Intelligent Systems Logical agents Chapter 7, AIMA This presentation owes some to V. Rutgers and D. OSU.
Knoweldge Representation & Reasoning
Artificial Intelligence
Let remember from the previous lesson what is Knowledge representation
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2005.
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Fall 98 Introduction to Artificial Intelligence LECTURE 7: Knowledge Representation and Logic Motivation Knowledge bases and inferences Logic as a representation.
Pattern-directed inference systems
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
1 CMSC 471 Fall 2002 Class #10/12–Wednesday, October 2 / Wednesday, October 9.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
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 CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
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.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Logical Agents Chapter 7 Part I. 2 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic.
Automated Reasoning in Propositional Logic Russell and Norvig: Chapters 6 and 9 Chapter 7, Sections 7.5—7.6 CS121 – Winter 2003.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
1 Intro to AI Logical Agents. 2 Intro to AI Outline Logic Efficient satisfiability testing by backtracking search Efficient satisfiability testing by.
Artificial Intelligence Logical Agents Chapter 7.
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.
Propositional Logic: Logical Agents (Part I)
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
Knowledge Representation and Reasoning
Knowledge and reasoning – second part
The Propositional Calculus
EA C461 – Artificial Intelligence Logical Agent
Semantics In propositional logic, we associate atoms with propositions about the world. We specify the semantics of our logic, giving it a “meaning”. Such.
Logical Agents Chapter 7 Selected and slightly modified slides from
Logical Agents Chapter 7.
Artificial Intelligence
Knowledge and reasoning – second part
Back to “Serious” Topics…
Logical Agents Chapter 7.
Knowledge Representation I (Propositional Logic)
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4

Propositional Logic2 Knowledge-Based Agent environment agent ? sensors actuators Knowledge base

Propositional Logic3 Types of Knowledge Procedural, e.g.: functions Such knowledge can only be used in one way -- by executing it Declarative, e.g.: constraints It can be used to perform many different sorts of inferences

Propositional Logic4 Logic Logic is a declarative language to: Assert sentences representing facts that hold in a world W (these sentences are given the value true) Deduce the true/false values to sentences representing other aspects of W

Propositional Logic5 Connection World-Representation World W Conceptualization Facts about W hold Sentences represent Facts about W represent Sentences entail

Propositional Logic6 Examples of Logics Propositional calculus A  B  C First-order predicate calculus ( x)( y) Mother(y,x) Logic of Belief B(John,Father(Zeus,Cronus))

Propositional Logic7 Symbols of PL Connectives: , , ,  Propositional symbols, e.g., P, Q, R, … True, False

Propositional Logic8 Syntax of PL sentence  atomic sentence | complex sentence atomic sentence  Propositional symbol, True, False Complex sentence   sentence | (sentence  sentence) | (sentence  sentence) | (sentence  sentence)

Propositional Logic9 Syntax of PL sentence  atomic sentence | complex sentence atomic sentence  Propositional symbol, True, False Complex sentence   sentence | (sentence  sentence) | (sentence  sentence) | (sentence  sentence) Examples: ((P  Q)  R) (A  B)  (  C)

Propositional Logic10 Order of Precedence     Examples:  A  B  C is equivalent to ((  A)  B)  C A  B  C is incorrect

Propositional Logic11 Model Assignment of a truth value – true or false – to every atomic sentence Examples: Let A, B, C, and D be the propositional symbols m = {A=true, B=false, C=false, D=true} is a model m’ = {A=true, B=false, C=false} is not a model With n propositional symbols, one can define 2 n models

Propositional Logic12 What Worlds Does a Model Represent? A model represents any world in which a fact represented by a proposition A having the value True holds and a fact represented by a proposition B having the value False does not hold A model represents infinitely many worlds

Propositional Logic13 Compare! BLOCK(A), BLOCK(B), BLOCK(C) ON(A,B), ON(B,C), ONTABLE(C) ON(A,B)  ON(B,C)  ABOVE(A,C)  ABOVE(A,C) HUMAN(A), HUMAN(B), HUMAN(C) CHILD(A,B), CHILD(B,C), BLOND(C) CHILD(A,B)  CHILD(B,C)  GRAND-CHILD(A,C)  GRAND-CHILD(A,C)

Propositional Logic14 Semantics of PL It specifies how to determine the truth value of any sentence in a model m The truth value of True is True The truth value of False is False The truth value of each atomic sentence is given by m The truth value of every other sentence is obtained recursively by using truth tables

Propositional Logic15 Truth Tables AB  A AA  BA  BA  B True FalseTrue False TrueFalse TrueFalse True FalseTrue FalseTrue

Propositional Logic16 Truth Tables AB  A AA  BA  BA  B True FalseTrue False TrueFalse TrueFalse True FalseTrue FalseTrue

Propositional Logic17 Truth Tables AB  A AA  BA  BA  B True FalseTrue False TrueFalse TrueFalse True FalseTrue FalseTrue

Propositional Logic18 About  ODD(5)  CAPITAL(Japan,Tokyo) EVEN(5)  SMART(Sam) Read A  B as: “If A IS True, then I claim that B is True, otherwise I make no claim.”

Propositional Logic19 Example (  A  B  C)  D  A Model: A=True, B=False, C=False, D=True F F T T T Definition: If a sentence s is true in a model m, then m is said to be a model of s

Propositional Logic20 A Small Knowledge Base 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.  Car-OK Sentences 1, 2, and 3  Background knowledge Sentences 4 and 5  Observed knowledge

Propositional Logic21 Model of a KB Let KB be a set of sentences A model m is a model of KB iff it is a model of all sentences in KB, that is, all sentences in KB are true in m

Propositional Logic22 Satisfiability of a KB A KB is satisfiable iff it admits at least one model; otherwise it is unsatisfiable KB1 = {P,  Q  R} is satisfiable KB2 = {  P  P} is satisfiable KB3 = {P,  P} is unsatisfiable valid sentence or tautology

Propositional Logic23 3-SAT Problem n propositional symbols P1,…,Pn KB consists of p sentences of the form Qi  Qj  Qk where: i  j  k are indices in {1,…,n} Qi = Pi or  Pi 3-SAT: Is KB satisfiable? 3-SAT is NP-complete

Propositional Logic24 KB : set of sentences  : arbitrary sentence KB entails  – written KB  – iff every model of KB is also a model of  Logical Entailment

Propositional Logic25 Logical Entailment KB : set of sentences  : arbitrary sentence KB entails  – written KB  – iff every model of KB is also a model of  Alternatively, KB  iff {KB,  } is unsatisfiable KB   is valid

Propositional Logic26 Logical Equivalence Two sentences  and  are logically equivalent – written    -- iff they have the same models, i.e.:    iff   and  

Propositional Logic27 Logical Equivalence Two sentences  and  are logically equivalent – written    -- iff they have the same models, i.e.:    iff   and   Examples: (    )  (    )         (    )      (    )    

Propositional Logic28 Logical Equivalence Two sentences  and  are logically equivalent – written    -- iff they have the same models, i.e.:    iff   and   Examples: (    )  (    )         (    )      (    )     One can always replace a sentence by an equivalent one in a KB

Propositional Logic29 Inference Rule An inference rule { ,  }  consists of 2 sentence patterns  and  called the conditions and one sentence pattern  called the conclusion 

Propositional Logic30 Inference Rule An inference rule { ,  }  consists of 2 sentence patterns  and  called the conditions and one sentence pattern  called the conclusion If  and  match two sentences of KB then the corresponding  can be inferred according to the rule 

Propositional Logic31 Example: Modus Ponens { ,  }  { ,  }   

Propositional Logic32 Example: Modus Ponens Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts Engine-Starts   Flat-Tire  Car-OK Battery-OK  Bulbs-OK { ,  }  { ,  }   

Propositional Logic33 Example: Modus Ponens Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts Engine-Starts   Flat-Tire  Car-OK Battery-OK  Bulbs-OK { ,  }  { ,  }   

Propositional Logic34 Example: Modus Ponens Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts Engine-Starts   Flat-Tire  Car-OK Battery-OK  Bulbs-OK { ,  }  { ,  }   

Propositional Logic35 Example: Modus Ponens Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK   Empty-Gas-Tank  Engine-Starts Engine-Starts   Flat-Tire  Car-OK Battery-OK  Bulbs-OK Headlights-Work { ,  }  { ,  }   

Propositional Logic36 Example: Modus Tolens Engine-Starts   Flat-Tire  Car-OK  Car-OK { ,  }  

Propositional Logic37 Example: Modus Tolens Engine-Starts   Flat-Tire  Car-OK  Car-OK  (Engine-Starts   Flat-Tire) { ,  }  

Propositional Logic38 Example: Modus Tolens Engine-Starts   Flat-Tire  Car-OK  Car-OK  (Engine-Starts   Flat-Tire)   Engine-Starts  Flat-Tire { ,  }  

Propositional Logic39 Other Examples { ,  }    { ,.}  { ,.}  Etc …   

Propositional Logic40 Inference I: Set of inference rules KB: Set of sentences Inference is the process of applying successive inference rules from I to KB, each rule adding its conclusion to KB

Propositional Logic41 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

Propositional Logic42 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. Battery-OK  Starter-OK  (5+6)

Propositional Logic43 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. Battery-OK  Starter-OK  (5+6) 10. Battery-OK  Starter-OK   Empty-Gas-Tank  (9+7)

Propositional Logic44 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. Battery-OK  Starter-OK  (5+6) 10. Battery-OK  Starter-OK   Empty-Gas-Tank  (9+7) 11. Engine-Starts  (2+10)

Propositional Logic45 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. 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)

Propositional Logic46 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. 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)  Engine-Starts  Flat-Tire

Propositional Logic47 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. 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)

Propositional Logic48 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. 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)

Propositional Logic49 Soundness An inference rule is sound if it generates only entailed sentences

Propositional Logic50 Soundness An inference rule is sound if it generates only entailed sentences All inference rules previously given are sound, e.g.: modus ponens: {   ,  }  

Propositional Logic51  Connective symbol (implication) Logical entailment Inference  KB  iff KB   is valid

Propositional Logic52 Soundness An inference rule is sound if it generates only entailed sentences All inference rules previously given are sound, e.g.: modus ponens: {   ,  }  The following rule: {   ,.}    is unsound, which does not mean it is useless  

Propositional Logic53 Completeness A set of inference rules is complete if every entailed sentences can be obtained by applying some finite succession of these rules Modus ponens alone is not complete, e.g.: from A  B and  B, we cannot get  A

Propositional Logic54 Proof The proof of a sentence  from a set of sentences KB is the derivation of  by applying a series of sound inference rules

Propositional Logic55 Proof The proof of a sentence  from a set of sentences KB is the derivation of  by applying a series of sound inference rules 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)

Propositional Logic56 Summary Knowledge representation Propositional Logic Truth tables Model of a KB Satisfiability of a KB Logical entailment Inference rules Proof