Quantifiers in Artificial Intelligence (especially in First-Order Logic)
Quantifiers are logical symbols used in first-order logic (FOL) to express statements about collections of objects. They allow us to generalize or specify conditions that apply to all or some elements in a domain.
1. Universal Quantifier ( ∀ ) – “For all”
-
Symbol:
∀
-
Meaning: The statement is true for every element in the domain.
-
Syntax:
∀x P(x)
“For all x, P(x) is true.”
- Example:
∀x (Human(x)⇒Mortal(x))
“All humans are mortal.”
2. Existential Quantifier ( ∃ ) – “There exists”
-
Symbol:
∃
-
Meaning: There exists at least one element in the domain for which the statement is true.
-
Syntax:
∃x P(x)\exists x\ P(x)
“There exists an x such that P(x) is true.”
- Example
∃x (Human(x)∧Rich(x))
“There exists at least one rich human.”
3. Nested Quantifiers
When quantifiers are used together, the order matters.
- Example:
∀x ∃y Loves(x,y)
“Everyone loves someone.”
(For every person x, there exists a person y that x loves.)
- But:
∃y ∀x Loves(x,y)
“There is someone who is loved by everyone.”
(A completely different meaning.)
Summary
Quantifier | Symbol | Meaning | Example |
---|---|---|---|
Universal Quantifier | ∀ | True for all elements | ∀x (Dog(x) → Animal(x)) |
Existential Quantifier | ∃ | True for at least one element | ∃x (Bird(x) ∧ CanFly(x)) |