cs 730 730w 830 intro ai
play

CS 730/730W/830: Intro AI First-order Logic Inference in FOL 1 - PowerPoint PPT Presentation

CS 730/730W/830: Intro AI First-order Logic Inference in FOL 1 handout: slides 730W journal entries were due Wheeler Ruml (UNH) Lecture 9, CS 730 1 / 16 First-order Logic Logic First-Order Logic The Joy of Power Inference in


  1. CS 730/730W/830: Intro AI First-order Logic Inference in FOL 1 handout: slides 730W journal entries were due Wheeler Ruml (UNH) Lecture 9, CS 730 – 1 / 16

  2. First-order Logic ■ Logic ■ First-Order Logic ■ The Joy of Power Inference in FOL First-order Logic Wheeler Ruml (UNH) Lecture 9, CS 730 – 2 / 16

  3. Logic A logic is a formal system: First-order Logic ■ Logic syntax: defines sentences ■ ■ First-Order Logic ■ The Joy of Power semantics: relation to world ■ Inference in FOL inference rules: reaching new conclusions ■ three layers: proof, models, reality flexible, general, and principled form of KR Wheeler Ruml (UNH) Lecture 9, CS 730 – 3 / 16

  4. First-Order Logic 1. Things: First-order Logic ■ Logic constants: John , Chair23 ■ ■ First-Order Logic ■ The Joy of Power functions (thing → thing): MotherOf(John) , SumOf(1,2) ■ Inference in FOL 2. Relations: predicates (objects → T/F): IsWet(John) , ■ IsSittingOn(MotherOf(John),chair23) 3. Complex sentences: connectives: IsWet(John) ∨ ■ IsSittingOn(MotherOf(John),Chair23) quantifiers and variables: ∀ person ... , ∃ person ... ■ Wheeler Ruml (UNH) Lecture 9, CS 730 – 4 / 16

  5. More First-Order Logic First-order Logic ∀ person ∀ time ( ItIsRaining ( time ) ∧ ■ Logic ■ First-Order Logic ¬∃ umbrella Holding ( person , umbrella , time )) → ■ The Joy of Power IsWet ( person , time ) Inference in FOL John loves Mary. All crows are black. Dolphin are mammals that live in the water. Everyone loves someone. Mary likes the color of one of John’s ties. I can’t hold more than one thing at a time. Wheeler Ruml (UNH) Lecture 9, CS 730 – 5 / 16

  6. The Joy of Power 1. Indirect knowledge: Tall(MotherOf(John)) First-order Logic ■ Logic 2. Counterfactuals: ¬ Tall ( John ) ■ First-Order Logic 3. Partial knowledge (disjunction): ■ The Joy of Power IsSisterOf ( b , a ) ∨ IsSisterOf ( c , a ) Inference in FOL 4. Partial knowledge (indefiniteness): ∃ x IsSisterOf ( x , a ) Wheeler Ruml (UNH) Lecture 9, CS 730 – 6 / 16

  7. First-order Logic Inference in FOL ■ Clausal Form ■ Example ■ Break ■ Unification ■ Example ■ Models ■ Refuatation Reasoning in First-order Logic ■ Completeness ■ EOLQs Wheeler Ruml (UNH) Lecture 9, CS 730 – 7 / 16

  8. Clausal Form 1. Eliminate → using ¬ and ∨ First-order Logic 2. Push ¬ inward using de Morgan’s laws Inference in FOL ■ Clausal Form 3. Standardize variables apart ■ Example 4. Eliminate ∃ using Skolem functions ■ Break ■ Unification 5. Move ∀ to front ■ Example 6. Move all ∧ outside any ∨ (CNF) ■ Models ■ Refuatation 7. Can finally remove ∀ and ∧ ■ Completeness ■ EOLQs Wheeler Ruml (UNH) Lecture 9, CS 730 – 8 / 16

  9. Example 1. Cats like fish. First-order Logic 2. Cats eat everything they like. Inference in FOL ■ Clausal Form 3. Joe is a cat. ■ Example ■ Break Prove: Joe eats fish. ■ Unification ■ Example ■ Models ■ Refuatation ■ Completeness ■ EOLQs Wheeler Ruml (UNH) Lecture 9, CS 730 – 9 / 16

  10. Break asst 1 ■ First-order Logic asst 2 ■ Inference in FOL ■ Clausal Form office hours ■ ■ Example ■ Break ■ Unification ■ Example ■ Models ■ Refuatation ■ Completeness ■ EOLQs Wheeler Ruml (UNH) Lecture 9, CS 730 – 10 / 16

  11. Unifying Two Terms 1. if one is a constant and the other is First-order Logic Inference in FOL 2. a constant: if the same, done; else, fail ■ Clausal Form 3. a function: fail ■ Example ■ Break 4. a variable: substitute constant for var ■ Unification 5. if one is a function and the other is ■ Example ■ Models 6. a different function: fail ■ Refuatation ■ Completeness 7. the same function: unify the two arguments lists ■ EOLQs 8. a variable: if var occurs in function , fail 9. otherwise, substitute function for var 10. otherwise, substitute one variable for the other Carry out substitutions on all expressions you are unifying! Build up substitutions as you go, carrying them out before checking expressions? See handout on website. Wheeler Ruml (UNH) Lecture 9, CS 730 – 11 / 16

  12. Example 1. Anyone who can read is literate. First-order Logic 2. Dolphins are not literate. Inference in FOL ■ Clausal Form 3. Some dolphins are intelligent. ■ Example 4. Prove: someone intelligent cannot read. ■ Break ■ Unification ■ Example Skolem, standardizing apart ■ Models ■ Refuatation ■ Completeness ■ EOLQs Wheeler Ruml (UNH) Lecture 9, CS 730 – 12 / 16

  13. Models A model is: First-order Logic Inference in FOL Propositional: a truth assignment for symbols. Exponential ■ Clausal Form number of models. ■ Example ■ Break First-order: a set of objects and an interpretation for ■ Unification constants, functions, and predicates (fixing referent of ■ Example ■ Models every term). Unbounded number of models. ■ Refuatation ■ Completeness No unique names assumption: constants not distinct. ■ EOLQs No closed world assumption: unknown facts not false. α valid iff true in every model α | = β iff β true in every model of α FOL is semi-decidable: if entailed, will eventually know Wheeler Ruml (UNH) Lecture 9, CS 730 – 13 / 16

  14. The Basis for Refutation Recall α | = β iff β true in every model of α . First-order Logic Inference in FOL 1. Assume KB | = α . ■ Clausal Form ■ Example 2. So if a model i satisfies KB, then i satisfies α . ■ Break 3. If i satisfies α , then doesn’t satisfy ¬ α . ■ Unification ■ Example 4. So no model satisfies KB and ¬ α . ■ Models 5. So KB ∧¬ α is unsatisfiable. ■ Refuatation ■ Completeness ■ EOLQs The other way: 1. Suppose no model that satisfies KB also satisfies ¬ α . In other words, KB ∧¬ α is unsatisfiable (= inconsistent = contradictory). 2. In every model of KB, α must be true or false. 3. Since in any model of KB, ¬ α is false, α must be true in all models of KB. Wheeler Ruml (UNH) Lecture 9, CS 730 – 14 / 16

  15. Completeness G¨ odel’s Completeness Theorem (1930) says a complete set of First-order Logic inference rules exists for FOL. Inference in FOL ■ Clausal Form Herbrand base: substitute all constants and combinations of ■ Example ■ Break constants and functions in place of variables. Potentially infinite! ■ Unification ■ Example ■ Models Herbrand’s Theorem (1930): If a set of clauses S is unsatisfiable, ■ Refuatation then there exists a finite subset of its Herbrand base that is also ■ Completeness ■ EOLQs unsatisfiable. Ground Resolution Thm: If a set of ground clauses is unsatisfiable, then the resolution closure of those clauses contains ⊥ . Robinson (1965): If there is a proof on ground clauses, there is a corresponding proof in the original clauses. Wheeler Ruml (UNH) Lecture 9, CS 730 – 15 / 16

  16. EOLQs Please write down the most pressing question you have about First-order Logic the course material covered so far and put it in the box on your Inference in FOL ■ Clausal Form way out. ■ Example Thanks! ■ Break ■ Unification ■ Example ■ Models ■ Refuatation ■ Completeness ■ EOLQs Wheeler Ruml (UNH) Lecture 9, CS 730 – 16 / 16

Recommend


More recommend