18_First_Order_Predicate_Logic
First-Order Predicate Logic (FOPL)
Overview
First-Order Predicate Logic (FOPL) is a more powerful form of logic than Propositional Logic. It allows us to express relationships between objects and use quantifiers to speak about properties of groups of objects.
Formal Systems
A formal system consists of:
- Set of Axioms (S): Fundamental truths or premises.
- Set of Inference Rules (L): Rules from which new statements can be logically derived.
Notation: ⟨S, L⟩ → knowledge base
Properties of Inference
- Soundness: An inference procedure
Lis sound if every statement derived fromSusingLis a logical consequence ofS. - Completeness: An inference procedure
Lis complete if every statement logically implied byScan be derived usingL.
Quantifiers
FOPL uses two primary quantifiers:
| Symbol | Name | Meaning |
|---|---|---|
| ∀ | Universal Quantifier | "For all" / "For every" |
| ∃ | Existential Quantifier | "There exists" |
Well-Formed Formulas (WFF)
WFFs are defined recursively:
- Every atomic formula is a WFF.
- If
PandQare WFFs, then¬P,P ∧ Q,P ∨ Q,P → Q, andP ↔ Qare also WFFs. - If
P(x)is a WFF, then∀x P(x)and∃x P(x)are also WFFs. - Only WFFs formed by applying the above rules a finite number of times are WFFs.
[!TIP] An expression with no variables is called a ground atom. Two WFFs with the same truth value at every interpretation are logically equivalent.
Example: Employee Tax Problem
Predicates:
E(x): x is an employeeGE(i(x), 1400): salary of x ≥ 1400T(x): x pays taxi(x): salary function of xS(x): x is sickP(y): y is the president
Representing Sentences:
- "All employees earning $1400 or more per year pay taxes."
∀x [E(x) ∧ GE(i(x), 1400) → T(x)]
- "Some employees are sick."
∃x [E(x) ∧ S(x)]
- "No employee earns more than the president."
∀x∀y [E(x) ∧ P(y) → ¬GE(i(x), i(y))]
Non-deductive Inference
While Deductive Inference (Logic) guarantees truth, other forms of reasoning are essential for common sense and scientific discovery:
- Abduction: Reasoning from effects to causes.
- Rule: P → Q
- Observation: Q
- Inference: P (Possible cause)
- Example: If it is raining, the grass is wet. The grass is wet, therefore it might be raining.
- Induction: Reasoning from specific instances to general rules.
- Observation: Object 1 has property P. Object 2 has property P...
- Inference: All objects in this class have property P.
- Example: Every swan I have seen is white; therefore, all swans are white.
Prenex Normal Form
A FOPL formula is in Prenex Normal Form if it consists of a string of quantifiers (the prefix) followed by a formula containing no quantifiers (the matrix).
General Structure:
(Q₁x₁)(Q₂x₂)...(Qₙxₙ) M(x₁, x₂, ..., xₙ)
- Where
Qᵢare either∀or∃. Mis the matrix (a quantifier-free expression).