Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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.)

2 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

3 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

4 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)

5 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: +1000 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

6 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?

7 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

8 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

9 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

10 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:  Ç 

11 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)

12 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

13 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

14 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

15 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

16 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 | …

17 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)

18 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))

19 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…

20 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)}

21 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”)

22 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


Download ppt "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."

Similar presentations


Ads by Google