logical foundations 2 a refresher comp34512
play

Logical Foundations 2 (A refresher) COMP34512 Sebastian Brandt - PowerPoint PPT Presentation

Logical Foundations 2 (A refresher) COMP34512 Sebastian Brandt brandt@cs.manchester.ac.uk (Slides by Bijan Parsia, bparsia@cs.man.ac.uk) Tuesday, 4 March 2014 Q2 deadline change was: 13 March (Thu) now: 18 March (Tue) Tuesday, 4 March 2014


  1. Logical Foundations 2 (A refresher) COMP34512 Sebastian Brandt brandt@cs.manchester.ac.uk (Slides by Bijan Parsia, bparsia@cs.man.ac.uk) Tuesday, 4 March 2014

  2. Q2 deadline change was: 13 March (Thu) now: 18 March (Tue) Tuesday, 4 March 2014

  3. Propositional Logic: Recall atomicProposition (A) ::= [A-Z][a-zA-Z]* (in camel case) ~ C compoundProposition (C, D) :: = ¬ C not C negation | C ∨ D | C ∨ D | C or D disjunction | C ∧ D | C & D | C and D conjunction | C → D | C ⊃ D | C only if D implication | C iff D bi-implication | C ≡ D | C ↔ D 3 Tuesday, 4 March 2014

  4. Propositional Logic: Simple The cat is on the mat. TheCatIsOnTheMat All cats are animals. Cat → Animal IMPLICIT universal Roses are red. Rose → Red quantification No cats are dogs. Cat → ¬ Dog If the moon is green (Moon and Green) → then it is made of cheese. MoonIsCheese Either the moon is made of cheese MoonIsCheese ∨ YouAreALiar or you’re a liar. Would you like soup or salad? ChoiceOfSoup ∨ ChoiceOfSalad I’ll love you just in case you love ILoveYou ↔ YouLoveMe me. Everyone loves someone SomeoneLovesEveryone → if someone loves everyone. EveryoneLovesSomeone 4 Tuesday, 4 March 2014

  5. Propositional Logic: Gensym The cat is on the mat. P All cats are animals. Q Roses are red. R → D No cats are dogs. S → ¬ D If the moon is green then it is made T → U of cheese. Either the moon is made of cheese U ∨ V or you’re a liar. Would you like soup or salad? W ∨ X I’ll love you just in case you love me. Y ↔ Z Everyone loves someone if someone A → B loves everyone. 5 Tuesday, 4 March 2014

  6. Propositionalise? • Self-Standing (nouny terms) • New Terms – General Eats • Animal only?? – Mammal » Cat ↔ eats only Dog ∧ » Dog ↔ eats only Cat ¬ » Cow → eats only not Animal → » Human → eats only (not Animal and Animal) ↔ • Modifiers (adjectivally terms) – Domesticated • Pet • Farmed – Wild – Carnivorous ↔ eats only Animal – Herbivorous ↔ eats only not Animal – Omnivorous ↔ Carnivorous and Herbivorous 6 Tuesday, 4 March 2014

  7. Propositionalise!! Proto-representation Propositional Logic Is it good? Animal, Mammal Mammal → Animal Incomplete Mammal, Cat, Dog, etc. Cat ... → Mammal Incomplete Cat ↔ eats only Dog Cat ↔ eatsOnlyDog Bad Dog ↔ eats only Cat Dog ↔ eatsOnlyCat Bad Cow eats only not Animal Cow → eatsOnlyNotAnimal Really bad! Human → eats only (not Human → Really bad! Hidden in Animal and Animal) eatsOnlyNotAnimalAndAnimal label even though syntax supports ... negation. Omnivorous Omnivorous Good! ↔ Carnivorous and ↔ Carnivorous ∧ Herbivorous Herbivorous ... 7 Tuesday, 4 March 2014

  8. Gensym!! English Propositional Logic Is it good? Animal, Mammal M → A Incomplete Mammal, Cat, Dog, etc. C ... → M Incomplete Cat ↔ eats only Dog C ↔ E1 Bad Dog ↔ eats only Cat D ↔ E2 Bad Cow eats only not Animal C → E3 Really bad! Human → eats only (not H → E4 Really bad! Animal and Animal) ... Omnivorous ↔ O ↔ C ∧ H Good! Carnivorous and Herbivorous ... 8 Tuesday, 4 March 2014

  9. Propositional Logic: Reasoning Fundamental Conception Deduction Valid arguments “If the premises are all true then the conclusion must be true” Sanctioned Inferences (Formula) Satisfiability/ Knowledge base consistency Entailment “Sound and Complete” Inference Recommended Inferences Depends on the application! “SAT” very common 9 Tuesday, 4 March 2014

  10. Evaluating Prop Logic as KR Role 1: Surrogacy We manipulate propositions. “States of affairs”, Role 2: Ontological Commitment i.e., static model, can’t handle relationships well Role 3: Theory of Reasoning Deduction Bad worst case complexity; Role 4: Efficient Computation Very good implementations Depends on the problem; Fairly Role 5: Human Communication easy to learn; Relies heavily on proposition names. Can we do better? What’s the obvious big problem? 10 Tuesday, 4 March 2014

  11. Predicate(FOL) Logic: Syntax Constant (c) ::= [a-z]+ Variable (v) ::= ʻ ? ʼ [a-z]+ Term (t) ::= Variable | Constant PredicateName (P) ::= [A-Z][a-zA-Z]* (in camel case) PredicateOfArityN (P/n) ::= P(t1,...,tn) compoundFormula (C, D) :: = ¬ C | C ∨ D | C ∧ D | C → D | C ↔ D | ∃ vC | ∀ vC ClosedFormula (a proposition) ::= P/n, where all t are constants | C where every v is bound by a quantifier • Still pretty simple syntax – Note we omit function symbols and equality • (We will use equality later) • Many syntaxes, but that’s ok • Key distinguishing feature: – “Atomics” have substructure! – Not all formulae are assertions 11 Tuesday, 4 March 2014

  12. Predicate Logic: Examples The cat is on the mat. On(cat, mat) All cats are animals. ∀ x(Cat(x) → Animal(x)) Roses are red. No cats are dogs. If the moon is green then it is made of cheese. Either the moon is made of cheese or you’re a liar. Would you like soup or salad? I’ll love you just in case you love me. Everyone loves someone if someone loves everyone. 12 Tuesday, 4 March 2014

  13. Predicate Logic: Semantics • Semantics is given in terms of a function – An “interpretation function” or “interpretation” – Maps WFFs to “meanings” • Different formulae map to different things – Closed formulae map to Truth Values • Like in propositional logic – For everything else, we introduce a “domain” • A set of elements – We map constants to elements of the domain – We map predicate names to sets • For unary predicates, we map to sets of elements • For binary predicates, we map to sets of pairs of elements • For trinary predicates, we map to sets of triples of elements • etc. • So we have “individuals” in “relations” 13 Tuesday, 4 March 2014

  14. Predicate Logic: Semantics • An interpretation consists of: – A domain, Δ , a non-empty set • Δ = {1, 2, 3....} – A function . I defined as follows • constant I ⟹ x ∈ Δ – bijan I ⟹ 1 • Predicate/1 I ⟹ C ⊆ Δ – Person I ⟹ {1} or the set of odd numbers • Predicate/2 I ⟹ C ⊆ Δ ⨉ Δ – Loves I ⟹ {<1,1>, <1,2>, <1,3>} • Etc. – We can get propositional assignments • P(c) I ⟹ True if c I ∈ P I and False otherwise • P(c1, c2) I ⟹ True if <c1 I ,c2 I > ∈ P I and False otherwise 14 Tuesday, 4 March 2014

  15. Predicate Logic: Semantics • Connectives? – If between ground or bound formulae, see truth tables • Variables & Quantifiers? – We need the notion of a variable mapping (substitution) σ • is a function mapping all variables to elements of the domain – like constants! but there are many mappings per interpretation – ∀ x( Ψ ) I ⟹ True if every possible σ makes Ψ True – ∃ x( Ψ ) I ⟹ True if at least one possible σ makes Ψ True • ∀ x ∃ y (Loves(x,y)) I5: Δ = {1,2 ,3} Loves I ={<1,2>, I1: Δ = {1} I3: Δ = {1,2} <2,1>} Loves I ={} Loves I ={<1,2>} I6: Δ = {1,2, ...} ٕ I4: Δ = {1,2} I2: Δ = {1} Loves I ={<x,x> Loves I ={<1,2>, Loves I ={<1,1>} | x ∈ ٕ } <2,1>} 15 Tuesday, 4 March 2014

  16. Some Key terms • Given a closed formula α , – An interpretation I is a model for α if α I ⟹ True • Often written as I ⊨ α • Most interpretations are not models! • We easily extend this to sets of closed formulae, Γ – Γ entails α if every model of Γ is a model of α • I.e., if for all I, if I ⊨ Γ , then I ⊨ α – If ∅ ⊨ α then α is a tautology (or valid) – If α (or Γ ) has a model then α (or Γ ) is consistent • or satisfiable – If α (or Γ ) has no models then α (or Γ ) is inconsistent • Questions (worst case): – Check how many I to determine whether α is inconsistent – Check how many elements to determine whether I ⊨ α • Predicate logic is hard! 16 Tuesday, 4 March 2014

  17. Predicatise? • Self-Standing (nouny terms) • New Terms – General Eats • Animal ∀ – Mammal » Cat ↔ eats only Dog ∧ » Dog ↔ eats only Cat ¬ » Cow → eats only not Animal → » Human → eats only (not Animal and Animal) ↔ • Modifiers (adjectivally terms) – Domesticated • Pet • Farmed – Wild – Carnivorous ↔ eats only Animal – Herbivorous ↔ eats only not Animal – Omnivorous ↔ Carnivorous and Herbivorous 17 Tuesday, 4 March 2014

  18. Predicate Logic: Reasoning Fundamental Conception Deduction Valid arguments “If the premises are all true then the conclusion must be true” Sanctioned Inferences Entailment “Sound and Complete” Inference Recommended Inferences Depends on the application! 18 Tuesday, 4 March 2014

  19. Evaluating Pred Logic as KR Role 1: Surrogacy Role 2: Ontological Commitment Role 3: Theory of Reasoning Role 4: Efficient Computation Role 5: Human Communication 19 Tuesday, 4 March 2014

Recommend


More recommend