Files
G4G0-2/AI & Data Mining/Week 25/Week 25 - Predicate Logic Quantifiers.md
2025-03-16 18:59:42 +00:00

6.2 KiB
Raw Blame History

Slide 1: Learning Objectives

  • Understand when the order of quantifiers is important.
  • Understand how ∀ and ∃ are connected.
  • Use and remember scoping rules.
  • Identify bound and free variables in formulae.
  • Establish the truth of formulae in predicate logic.
  • Understand why predicate logic is described as undecidable.
  • Understand the difference between zero-order, first-order, and higher-order predicate logics.

Slide 2: Objectives & Recap

  • Quantifiers and their alternative view.
  • Distributive laws of quantifiers.
  • De Morgan's laws with quantifiers.
  • Scope of quantifiers.
  • Bound and free variables.

Slide 3: The Universal Quantifier (∀)

  • Pronounced as "for all".
  • Example: ∀x (human(x) ⇒ mortal(x)) = All humans are mortal.
  • In terms of conjunction: ∀x p(x) ≡ p(x₁) ∧ p(x₂) ∧... ∧ p(xₙ)

Slide 4: The Existential Quantifier (∃)

  • Pronounced as "there exists" or "for some".
  • Example: ∃x (human(x) ∧ happy(x)) = Some humans are happy.
  • In terms of disjunction: ∃x p(x) ≡ p(x₁) p(x₂) ... p(xₙ)

Slide 5: Distributive Laws of Quantifiers

  • ∀x (p(x) ∧ q(x)) ≡ (∀x p(x)) ∧ (∀x q(x))
  • ∃x (p(x) q(x)) ≡ (∃x p(x)) (∃x q(x))

Slide 6: The Order of Quantification

  • Example 1 (Everyone loves someone): ∀x ∃y loves(x, y)
  • Example 2 (There is someone loved by everyone): ∃y ∀x loves(x, y)

Slide 7: De Morgan's Laws and Quantifiers

  • ¬∃x p(x) ≡ ∀x ¬p(x)
  • ¬∀x p(x) ≡ ∃x ¬p(x)

Slide 8: Scope of Quantifiers

  • In absence of brackets, scope extends to the end of the formula.
  • Brackets can enforce different scoping patterns.

Slide 9: Bound and Free Variables

  • Bound variable: occurrence introduced by a quantifier within its scope.
    • Example:
      Formula             Variable status
      child(x)            Only one occurrence of x, free.
      ∀x child(x) ∧ clever(x) Both occurrences of x are bound by the same quantifier.
      ((∀x child(x)) ∧ clever(x)) The first occurrence of x is bound, the second is free.
      
  • Free variable: occurrence not within any quantifier's scope.

Slide 10: Meaning of Bound Variables

  • The meaning of a bound variable does not depend on its name.
    • Example:
      ∀x (child(x) ∧ clever(x)) ⇒ ∃y loves(y, x)
      ∀B (child(B) ∧ clever(B)) ⇒ ∃C loves(C, B)
      

Slide 11: Meaning of Free Variables

  • Free variables denote unknowns or unspecified objects.
    • Example:
      ∀x (child(x) ∧ clever(x)) ⇒ x is loved.
      ∀x (child(x) ∧ clever(x)) ⇒ z is loved.
      

Slide 12: Exercise

  • Identify bound and free variables in the formula:
    ∃x taller(y, x) ∃x ∃y taller(x, y) ∧ taller(x, z)
    
  • Solution:
    • In the first formula: x is bound, y is free.
    • In the second formula: y is bound by ∃y, z is free. Both occurrences of x are bound and refer to the same variable.

Slide 13: The Equality Symbol (=)

  • ⊢ Richard has at least two brothers:
    ∃x ∃y (brother(x, richard) ∧ brother(y, richard) ∧ ¬(x = y))
    
  • Definition of sibling using parent:
    ∀x ∀y sibling(x, y) ≡ (¬(x = y) ∧ ∃m ∃f ¬(m = f) ∧ parent(m, x) ∧ parent(f, x) ∧ parent(m, y) ∧ parent(f, y))
    

Slide 14: Establishing the Truth Values of Formulae

  • Example (slide 21 and 22):
    • Individuals: Ahmed, Khan, Patel, Scott.
    • Properties: male, tall, short.
    • Formula: ∀x (male(x) ⇒ tall(x) short(x))
    • Truth table shows the formula is false (Patel is male but not tall or short).

Slide 15: Exercise

  • Given individuals, properties, and true propositions as in slide 23.
  • Evaluate the truth of: ∀x ¬male(x) ⇒ short(x)
  • Solution (slide 24):
    x     male(x)    ¬male(x)   short(x)   ¬male(x) ⇒ short(x)
    Ahmed    T      F          F         F        T
    Khan     F      T          T         T        T
    Patel    T      F          F         F        T
    Scott    T      F          T         F        F
    
  • The formula is false (Patel is male but not short).

Slide 16: Example Involving ∃

  • Given individuals, properties, and true propositions as in slide 25.
  • Formula: ∃x (male(x) ∧ ¬tall(x) ⇒ short(x))
  • Truth table (slide 26):
    x     male(x)   ¬tall(x)    short(x)   ¬tall(x) ⇒ short(x)   male(x) ∧ ¬tall(x) ⇒ short(x)
    Ahmed    T      F          F         F        T            T
    Khan     F      F          T         F        F            F
    Patel    T      F          F         F        F            F
    Scott    T      T          T         F        T            F
    
  • The formula is true (Scott is male, not tall but short).

Slide 17: Exercise

  • Given individuals, properties, and true propositions as in slide 27.
  • Evaluate the truth of: ∃x (male(x) ∧ (tall(x) ¬short(x)))
  • Solution (slide 28):
    x     male(x)   tall(x)    short(x)   ¬short(x)   tall(x)  ¬short(x)   male(x) ∧ (tall(x)  ¬short(x))
    Ahmed    T      T          F         T            T             T            T
    Khan     F      F          T         F            F             F            F
    Patel    T      T          F         F            T             T            F
    Scott    T      F          T         F            F             F            F
    
  • The formula is true (Ahmed and Patel are males, tall or not short).

Slide 29: Predicate Logic is Undecidable

  • Universal quantification introduces computational impossibility when testing truth values with an infinite number of possible values.

Slide 30: First-order Predicate Logic

  • Quantifiers refer only to objects (constants), not predicate or function names.
  • Propositional logic is zero-order logic.

Slide 31: Summary

  • Order of quantifiers matters when both ∀ and ∃ are present.
  • Quantifiers are connected through negation, obey De Morgan's laws.
  • Scope of quantifiers extends to the end of the formula without brackets.
  • Bound variables are introduced by a quantifier within its scope; free variables are not within any quantifier's scope.

Slide 32: Reading, References and Acknowledgements

  • Reading from Artificial Intelligence textbook by Russell and Norvig.
  • References: Introductory Logic and Sets for Computer Scientists by Nissanke.