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

logical foundations 2 a refresher comp34512
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 2

Q2 deadline change was: 13 March (Thu) now: 18 March (Tue)

Tuesday, 4 March 2014

slide-3
SLIDE 3

Propositional Logic: Recall

3

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

Tuesday, 4 March 2014

slide-4
SLIDE 4

Propositional Logic: Simple

4

The cat is on the mat. TheCatIsOnTheMat All cats are animals. Cat → Animal Roses are red. Rose → Red No cats are dogs. Cat → ¬ Dog If the moon is green then it is made of cheese. (Moon and Green) → MoonIsCheese Either the moon is made of cheese

  • r you’re a liar.

MoonIsCheese ∨ YouAreALiar Would you like soup or salad? ChoiceOfSoup ∨ ChoiceOfSalad I’ll love you just in case you love me. ILoveYou ↔ YouLoveMe Everyone loves someone if someone loves everyone. SomeoneLovesEveryone → EveryoneLovesSomeone

IMPLICIT universal quantification

Tuesday, 4 March 2014

slide-5
SLIDE 5

Propositional Logic: Gensym

5

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

  • f cheese.

T → U Either the moon is made of cheese

  • r you’re a liar.

U ∨ V 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 loves everyone. A → B

Tuesday, 4 March 2014

slide-6
SLIDE 6

Propositionalise?

  • Self-Standing (nouny terms)

– General

  • Animal

– Mammal » Cat ↔ eats only Dog » Dog ↔ eats only Cat » Cow → eats only not Animal » Human → eats

  • nly (not Animal and Animal)
  • Modifiers (adjectivally terms)

– Domesticated

  • Pet
  • Farmed

– Wild – Carnivorous ↔ eats only Animal – Herbivorous ↔ eats only not Animal – Omnivorous ↔ Carnivorous and Herbivorous

  • New Terms

Eats

  • nly??

∧ ¬ → ↔

6

Tuesday, 4 March 2014

slide-7
SLIDE 7

Propositionalise!!

7

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 Animal and Animal) Human → eatsOnlyNotAnimalAndAnimal Really bad! ... Omnivorous ↔ Carnivorous and Herbivorous Omnivorous ↔ Carnivorous ∧ Herbivorous Good! ...

Hidden in label even though syntax supports negation.

Tuesday, 4 March 2014

slide-8
SLIDE 8

Gensym!!

8

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 Animal and Animal) H → E4 Really bad! ... Omnivorous ↔ Carnivorous and Herbivorous O ↔ C ∧ H Good! ...

Tuesday, 4 March 2014

slide-9
SLIDE 9

Propositional Logic: Reasoning

9

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

Tuesday, 4 March 2014

slide-10
SLIDE 10

Evaluating Prop Logic as KR

10

Role 1: Surrogacy Role 2: Ontological Commitment Role 3: Theory of Reasoning Role 4: Efficient Computation Role 5: Human Communication We manipulate propositions. “States of affairs”, i.e., static model, can’t handle relationships well Deduction Bad worst case complexity; Very good implementations Depends on the problem; Fairly easy to learn; Relies heavily on proposition names.

Can we do better? What’s the obvious big problem?

Tuesday, 4 March 2014

slide-11
SLIDE 11

Predicate(FOL) Logic: Syntax

  • 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

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

Tuesday, 4 March 2014

slide-12
SLIDE 12

Predicate Logic: Examples

12

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.

Tuesday, 4 March 2014

slide-13
SLIDE 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

slide-14
SLIDE 14

Predicate Logic: Semantics

  • An interpretation consists of:

– A domain, Δ, a non-empty set

  • Δ = {1, 2, 3....}

– A function .I defined as follows

  • constantI ⟹ x ∈ Δ

– bijanI ⟹ 1

  • Predicate/1I ⟹ C ⊆ Δ

– PersonI ⟹ {1} or the set of odd numbers

  • Predicate/2I ⟹ C ⊆ Δ ⨉ Δ

– LovesI ⟹ {<1,1>, <1,2>, <1,3>}

  • Etc.

– We can get propositional assignments

  • P(c)I ⟹ True if cI ∈ PI and False otherwise
  • P(c1, c2)I ⟹ True if <c1I,c2I>∈ P I and False otherwise

14

Tuesday, 4 March 2014

slide-15
SLIDE 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))

15

I1: Δ = {1} LovesI ={} I2: Δ = {1} LovesI={<1,1>} I3: Δ = {1,2} LovesI={<1,2>} I4: Δ = {1,2} LovesI={<1,2>, <2,1>} I5: Δ = {1,2,3} LovesI={<1,2>, <2,1>} I6: Δ = {1,2, ...} ٕ LovesI={<x,x> | x ∈ ٕ }

Tuesday, 4 March 2014

slide-16
SLIDE 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

slide-17
SLIDE 17

Predicatise?

  • Self-Standing (nouny terms)

– General

  • Animal

– Mammal » Cat ↔ eats only Dog » Dog ↔ eats only Cat » Cow → eats only not Animal » Human → eats

  • nly (not Animal and Animal)
  • Modifiers (adjectivally terms)

– Domesticated

  • Pet
  • Farmed

– Wild – Carnivorous ↔ eats only Animal – Herbivorous ↔ eats only not Animal – Omnivorous ↔ Carnivorous and Herbivorous

  • New Terms

Eats ∀ ∧ ¬ → ↔

17

Tuesday, 4 March 2014

slide-18
SLIDE 18

Predicate Logic: Reasoning

18

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!

Tuesday, 4 March 2014

slide-19
SLIDE 19

Evaluating Pred Logic as KR

19

Role 1: Surrogacy Role 2: Ontological Commitment Role 3: Theory of Reasoning Role 4: Efficient Computation Role 5: Human Communication

Tuesday, 4 March 2014