1 / 27

CS 416 Artificial Intelligence

CS 416 Artificial Intelligence. Lecture 11 Logical Agents Chapter 7. Midterm Exam. Midterm will be on Thursday, March 13 th It will cover material up until Feb 27 th. Reasoning w/ propositional logic. Remember what we’ve developed so far Logical sentences

Download Presentation

CS 416 Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 416Artificial Intelligence Lecture 11 Logical Agents Chapter 7

  2. Midterm Exam • Midterm will be on Thursday, March 13th • It will cover material up until Feb 27th

  3. Reasoning w/ propositional logic • Remember what we’ve developed so far • Logical sentences • And, or, not, implies (entailment), iff (equivalence) • Syntax vs. semantics • Truth tables • Satisfiability, proof by contradiction

  4. Logical Equivalences • Know these equivalences

  5. Reasoning w/ propositional logic • Inference Rules • Modus Ponens: • Whenever sentences of form a => b and a are giventhe sentence b can be inferred • R1: Green => Martian • R2: Green • Inferred: Martian

  6. Reasoning w/ propositional logic • Inference Rules • And-Elimination • Any of conjuncts can be inferred • R1: Martian ^ Green • Inferred: Martian • Inferrred: Green • Use truth tables if you want to confirm inference rules

  7. Example of a proof P? P? ~P ~B B P? P?

  8. Example of a proof P? ~P ~P ~B B ~P P?

  9. Constructing a proof • Proving is like searching • Find sequence of logical inference rules that lead to desired result • Note the explosion of propositions • Good proof methods ignore the countless irrelevant propositions

  10. Monotonicity of knowledge base • Knowledge base can only get larger • Adding new sentences to knowledge base can only make it get larger • If (KB entails a) • ((KB ^ b) entails a) • This is important when constructing proofs • A logical conclusion drawn at one point cannot be invalidated by a subsequent entailment

  11. How many inferences? • Previous example relied on application of inference rules to generate new sentences • When have you drawn enough inferences to prove something? • Too many make search process take longer • Too few halt logical progression and make proof process incomplete

  12. Resolution • Unit Resolution Inference Rule • If m and li arecomplementaryliterals

  13. Resolution Inference Rule • Also works with clauses • But make sure each literal appears only once

  14. Resolution and completeness • Any complete search algorithm, applying only the resolution rule, can derive any conclusion entailed by any knowledge base in propositional logic • More specifically, refutation completeness • Able to confirm or refute any sentence • Unable to enumerate all true sentences

  15. What about “and” clauses? • Resolution only applies to “or” clauses • Every sentence of propositional logic can be transformed to a logically equivalent conjunction of disjunctions of literals • Conjunctive Normal Form (CNF) • A sentence expressed as conjunction of disjunction of literals • k-CNF: exactly k literals per clause

  16. CNF

  17. An algorithm for resolution • We wish to prove KB entails a • Must show (KB ^ ~a) is unsatisfiable • No possible way for KB to entail (not a) • Proof by contradiction

  18. An algorithm for resolution • Algorithm • KB ^ ~a is put in CNF • Each pair with complementary literals is resolved to produce new clause which is added to KB (if novel) • Cease if no new clauses to add (~a is not entailed) • Cease if resolution rule derives empty clause (~a is entailed)

  19. Example of resolution • Proof that there is not a pit in P1,2: ~P1,2 • KB ^ P1,2 leads to empty clause • Therefore ~P1,2 is true

  20. Formal Algorithm

  21. Horn Clauses • Horn Clause • Disjunction of literals with at most one is positive • (~a V ~b V ~c V d) • (~a V b V c V ~d) Not a Horn Clause

  22. Horn Clauses • Can be written as a special implication • (~a V ~b V c)  (a ^ b) => c • (~a V ~b V c) == (~(a ^ b) V c) … de Morgan • (~(a ^ b) V c) == ((a ^ b) => c … implication elimination

  23. Horn Clauses • Permit straightforward inference determination • Forward chaining • Backward chaining

  24. Horn Clauses • Permit determination of entailment in linear time (in order of knowledge base size)

  25. Forward Chaining

  26. Forward Chaining • Properties • Sound • Complete • All entailed atomic sentence will be derived • Data Driven • Start with what we know • Derive new info until we discover what we want

  27. Backward Chaining • Start with what you want to know, a query (q) • Look for implications that conclude q • Goal-Directed Reasoning

More Related