Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian1 Reasoning/Inference  Given a set of facts/beliefs/rules/evidence.

Slides:



Advertisements
Similar presentations
Russell and Norvig Chapter 7
Advertisements

Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Knowledge Based Systems: Logic and Deduction Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Fall 2005.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
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.
Cooperating Intelligent Systems Logical agents Chapter 7, AIMA This presentation owes some to V. Rutgers and D. OSU.
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
Cooperating Intelligent Systems Logical agents Chapter 7, AIMA This presentation owes some to V. Rutgers and D. OSU.
Knoweldge Representation & Reasoning
Artificial Intelligence
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 5 Dr Souham Meshoul CAP492.
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.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2008.
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
Logical Agents. Knowledge bases Knowledge base = set of sentences in a formal language Declarative approach to building an agent (or other system): 
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
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 Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
Lecture 7: Knowledge Representation and Logic Heshaam Faili University of Tehran Motivation Knowledge bases and inferences Logic as.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 17, 2012.
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.
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.
For Friday Read chapter 8 Homework: –Chapter 7, exercise 1.
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.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 10 of 42 Wednesday, 13 September.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Russell & Norvig Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean)
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7 Part I. 2 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
1 Knowledge Representation Logic and Inference Propositional Logic Vumpus World Knowledge Representation Logic and Inference Propositional Logic Vumpus.
1 Intro to AI Logical Agents. 2 Intro to AI Outline Logic Efficient satisfiability testing by backtracking search Efficient satisfiability testing by.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
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.
CS666 AI P. T. Chung Logic Logical Agents Chapter 7.
Propositional Logic: Logical Agents (Part I)
EA C461 – Artificial Intelligence Logical Agent
Logical Agents Chapter 7 Selected and slightly modified slides from
Logical Agents Reading: Russell’s Chapter 7
Logical Agents Chapter 7.
Artificial Intelligence
Logical Agents Chapter 7.
Logical Agents Chapter 7 How do we reason about reasonable decisions
CS 416 Artificial Intelligence
Knowledge Representation I (Propositional Logic)
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian1 Reasoning/Inference  Given a set of facts/beliefs/rules/evidence Evaluate a given statement Determine the truth of a statement Determine the probability of a statement Find a statement that satisfies a set of constraints SAT Find a statement that optimizes a set of constraints MAX-SAT (Assignment that maximizes the number of satisfied constraints.) Most probable explanation (MPE) (Setting of hidden variables that best explains observations.)

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian2 Examples of Reasoning Problems  Evaluate a given statement Chess: status(position,LOST)? Backgammon: Pr(game-is-lost)?  Find a satisfying assignment Chess: Find a sequence of moves that will win the game  Optimize Backgammon: Find the move that is most likely to win Medical Diagnosis: Find the most likely disease of the patient

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian3 Facts, Beliefs, Evidence must be represented somehow  Propositional Logic Statements about a fixed, finite number of objects  First-Order Logic Statements about a variable, possibly-infinite, set of objects and relations among them  Probabilistic Propositional Logic Statements of probability over the rows of the truth table  Probabilistic First-Order Logic Statements of probability over the possible models of the axioms

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian4 Propositional Logic Sentence ::= AtomicSentence | ComplexSentence AtomicSentence ::= True | False | symbol Symbol ::= P | Q | R | … ComplexSentence ::= : Sentence | (Sentence Æ Sentence) | (Sentence Ç Sentence) | (Sentence ) Sentence) | (Sentence, Sentence)

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian5 Application: WUMPUS  Maze of caves  A WUMPUS is in one of the caves  Some of the caves have pits  One of the caves has gold  Agent has an arrow  Performance measure: for picking up the goal; –1000 for being eaten by the WUMPUS or falling into a pit; –1 for each action; –10 for shooting the arrow  Actions: forward, turn left, turn right, shoot arrow, grab gold  Sensors: Stench (cave containing WUMPUS and its four neighbors) Breeze (cave containing pit and its four neighbors) Glitter (cave containing gold) Scream (if arrow kills WUMPUS) Bump (if agent hits wall)  Exactly one WUMPUS in cave choosen uniformly at random (except for Start state)  Each cave has probability 0.2 of pit

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian6 Inference from Sensors  Reasoning problem: Given sensors, what can we infer about the state of the world?

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian7 Some Sentences  There is no wumpus in 1,1: : W 1,1  If there is a wumpus in 2,2, then there is a stench in 1,2 and 2,3 and 3,2 and 2,1 W 2,2 ) S 1,2 Æ S 2,3 Æ S 3,2 Æ S 2,1  There is gold in 3,3 iff there is glitter in 3,3: Go 3,3, Gl 3,3  There is only one wumpus: W 1,1 Ç W 1,2 Ç … Ç W 4,4 W 1,1 ) : W 1,2 Æ : W 1,3 Æ … Æ : W 4,4 W 1,2 ) : W 1,1 Æ : W 1,3 Æ … Æ : W 4,4

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian8 Sensor Readings = Sentences  Starting state: no glitter, no stench, no breeze : Gl 1,1 : S 1,1 : B 1,1

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian9 Is there a WUMPUS in 2,1?  Logical Reasoning allows us to draw inferences: : B 1,1 W 1,2 ) B 1,1 Æ B 2,2 Æ B 1,3  These imply (by the rule of “deny consequent”) : W 1,2

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian10 Rules of Logical Inference  Modus Ponens Given:  )  and  Conclude:   Deny Consequent Given:  )  and :  Conclude: :   AND Elimination Given:  Æ  Conclude:   Deny Disjunct Given:  Ç  and :  Conclude   Resolution Given:  Ç  and :  Ç  Conclude:  Ç 

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian11 Resolution: A useful inference rule for computation  Convert all statements to conjunctive normal form (CNF)  )  becomes {:  Ç  }  Æ  becomes {  }, {  } ,  becomes {:  Ç  }, {  Ç :  }  Negate query  Apply resolution to search for the empty clause (contradiction).  Useful primarily for First-Order Logic (see below)

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian12 Satisfiability  Given a set of sentences, is there a satisfying assignment of True and False to each proposition symbol that makes the sentences true?  To decide if  is true given , we check if  Æ  is satisfiable

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian13 Complete Inference Procedure  The Davis-Putnam algorithm is a complete inference procedure for propositional logic If there exists a satisfying assignment, it will find it. Can be very efficient. But can be very slow, too. SAT is NP-Complete

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian14 Incomplete Inference Procedure  WALKSAT is a stochastic procedure (a form of stochastic hill climbing) that finds a satisfying assignment rapidly but only with high probability  Can be extended to handle MAX-SAT problems where the goal is to find an assignment that maximizes the number of satisfied clauses

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian15 First-Order Logic  Propositional Logic requires that the number of objects in the world be fixed so that we can give each one a name: W 1,1, W 1,2, … B 1,1, B 1,2, … G 1,1, G 1,2, …  This does not scale to worlds of variable or unknown size  It is also very tedious to write down all of the clauses describing the Wumpus world

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian16 First-Order Logic permits variables that range over objects Sentence ::= AtomicSentence | Sentence Connective Sentence | Quantifier Variable, … Sentence | : Sentence | (Sentence) AtomicSentence ::= Predicate(Term),…) | Term = term Term ::= Function(Term,…) | Constant | Variable Connective ::= ) | Æ | Ç |, Quantifier ::= 8 | 9 Constant ::= A | X 1 | John Variable ::= a | x | s Predicate ::= Before | HasColor | Raining | … Function ::= Mother | LeftLegOf | …

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian17 Compact Description of Wumpus Odor  If a wumpus is in a cave, then all adjacent caves are smelly 8 ℓ 1, ℓ 2 At(Wumpus, ℓ 1 ) Æ Adjacent(ℓ 1, ℓ 2 ) ) Smelly(ℓ 2 )  Compare propositional logic: W 2,2 ) S 2,1 Æ S 2,3 Æ S 1,2 Æ S 3,2 (and 15 similar sentences in the 4x4 world)

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian18 Definition of Adjacent  8 ℓ 1, ℓ 2 Adjacent(ℓ 1, ℓ 2 ), (row( ℓ 1 ) = row( ℓ 2 ) Æ (col( ℓ 1 ) = col(ℓ 2 ) + 1 Ç col(ℓ 1 ) = col(ℓ 2 ) – 1)) Ç (col(ℓ 1 ) = col(ℓ 2 ) Æ (row(ℓ 1 ) = row(ℓ 2 ) + 1 Ç row(ℓ 1 ) = row(ℓ 2 ) – 1))

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian19 Inference Rules for Quantifiers  Universal Elimination: Given 8 x  Conclude S UBST ({x/g},  ) [g must be term that does not contain variables]  Example: Given 8 x Likes(x,IceCream) Conclude Likes(Ben,IceCream) S UBST (x/Ben, Likes(x,IceCream)) ´ Likes(Ben,IceCream)  Many other rules…

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian20 Unification  Unification is a pattern matching operation that finds a substitution that makes two sentences match: U NIFY (p,q) =  iff S UBST ( ,p) = S UBST ( ,q)  Example: U NIFY (Knows(John,x), Knows(John,Jane)) = {x/Jane} U NIFY (Knows(John,x), Knows(y,Mother(y))) = {y/John,x/Mother(John)}

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian21 First-Order Resolution  Given:  Ç , :  Ç  and U NIFY ( ,  )=   Conclude: S UBST ( ,  Ç  )  Resolution is a refutation complete inference procedure for First-Order Logic If a set of sentences contains a contradiction, then a finite sequence of resolutions will prove this. If not, resolution may loop forever (“semi- decidable”)

Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian22 Summary  Propositional logic finite worlds logical entailment is decidable Davis-Putnam is complete inference procedure  First-Order logic infinite worlds logical entailment is semi-decidable Resolution procedure is refutation complete