First Order Logic

This page defines first order logic by instantiating the components of a logic defined as part of the generalities on logics. First order logic FOL is the tuple (SymFOL, ForFOL, IntFOL, ⊨FOL) that we define piece by piece in later sections.

Syntax

Symbols

We define the set C = {¬, ∧, ∨, →, ↔} of logical connectors (all different from each other), the set B = {‘(’, ‘)’, ‘,’} of opening and closing parentheses and comma (B is for brackets) disjoint from C, the set Q = {∀, ∃} of quantifiers disjoint from B and C, an infinite set U disjoint from B, C, and Q whose members are called constants, an infinite set V disjoint from B, C, Q, and U whose members are called variables, for all integer n > 0, an infinite set Fn disjoint from all other sets, whose members are called functions of arity n, and for all integer n ≥ 0, an infinite set Pn disjoint from all other sets, whose members are called predicates of arity n.

Symbols of FOL
The symbols of FOL are SymFOL = BCQUV ⋃ (F1F2 ⋃ … ⋃ Fi ⋃ … ) ⋃ (P0P1 ⋃ … ⋃ Pi ⋃ … ).

Sometimes, predicates of arity 0 are distinguished as a separate set and are called propositions. Some other times, constants are presented as functions of arity 0.

As with propositions in propositional logic, we will write distinct constants, functions or predicates with distinct sequences of latin characters like so: Louis-XIV, motherOf, Person, etc.

Formulas

Defining formulas in FOL requires some additional definitions.

Terms
A term is either a constant or, if f is a function of arity n and t1, … , tn are terms, then f(t1, … , tn) is a term.
Formulas of FOL

Formulas are recursively built as the smallest set ForFOL such that:

  • for all arity n, all p ∈ Pn, and all tuple of terms t1, … , tn, p(t1, … , tn) ∈ ForFOL;
  • for all φ ∈ ForFOL, ¬φ ∈ ForFOL;
  • for all φ, ψ ∈ ForFOL, (φ ∧ ψ) ∈ ForFOL;
  • for all φ, ψ ∈ ForFOL, (φ ∨ ψ) ∈ ForFOL;
  • for all φ, ψ ∈ ForFOL, (φ → ψ) ∈ ForFOL;
  • for all φ, ψ ∈ ForFOL, (φ ↔ ψ) ∈ ForFOL;
  • for all φ ∈ ForFOL and all x ∈ V, x φ ∈ ForFOL;
  • for all φ ∈ ForFOL and all x ∈ V, x φ ∈ ForFOL.
Argument
In a term t = f(t1, … , tn) that consists of an n-ary function with n terms, t1, … , tn are called the arguments of t. In a formula φ = p(t1, … , tn) that consists of an n-ary predicate with n terms, t1, … , tn are called the arguments of φ.

Note that a predicate of arity 0 has an empty list of arguments.

Atom
An atom is a formula φ = p(t1, … , tn) that is reduced to a single predicate with its arguments.

Note that we use a light shading on formulas in order to clearly distinguish them from other syntactic constructs such as terms etc.

By convention, the following operator precedence is assumed: ∀ and ∃ has higher precedence than ¬; ¬ has higher precedence than ∧; ∧ has higher precedence than ∨; and ∨ has higher precedence than → and ↔. As a result, it is possible to write formulas by leaving parentheses implicit. Therefore, the following formulas are considered well formed:

z (∃x P(f(x),c) ∨ Q(y)) ∧ (R(z) ∨ ¬B) → D(y,z)
implicitly meaning ((∀z (∃x P(f(x),c) ∨ Q(y)) ∧ (R(z) ∨ ¬B)) → D(y,z))

x Airplane(x) → Vehicle(x) ∧ IsFlying(x)
implicitly meaning (∀x Airplane(x) → (Vehicle(x) ∧ IsFlying(x))), which is different in meaning from x (Airplane(x) → (Vehicle(x) ∧ IsFlying(x)))

In addition to these usual definitions that apply to any logic, we introduce special syntactic forms that are generally useful for algorithms.

Literal
A literal L is a formula that is either an atom or the negation of an atom.
Prenex normal form (PNF)
A formula φ ∈ ForFOL is in prenex normal form (or PNF for short) if and only if φ = Q1x1 … Qnxn ψ for some n ∈ ℕ, some quantifiers Q1, … , Qn ∈ Q, some variables x1, … , xn ∈ V, and some formula ψ ∈ ForFOL where no quantifier appear in the quantifiers.

In a PNF Q1x1 … Qnxn ψ, the part Q1x1 … Qnxn is called the prefix and ψ is called the matrix.

Skolem normal form (SNF)
A formula φ ∈ ForFOL is in Skolem normal form (or SNF for short) if and only if φ is in PNF and its prefix only contains universal quantifiers.
Conjunctive normal form (CNF)
A formula φ ∈ ForFOL is in conjunctive normal form (or CNF for short) if and only if φ is in SNF and the matrix is a conjunction of disjunction of literals.
Free and bound variable occurrence

A variable x ∈ V occurs free or bound or both, or neither in a formula φ ∈ ForFOL according to the following recursive rules:

  • if x does not occur in φ then it neither occurs free nor bound;
  • if φ is a literal, x occurs free and not bound if and only if it occurs in φ;
  • if φ = ¬ψ, x occurs free (respectively bound) if and only if it occurs free (respectively bound) in φ;
  • if φ = 1 ∧ ψ2) (or 1 ∨ ψ2), or 1 → ψ2), or 1 ↔ ψ2)), then x occurs free (respectively bound) in φ if and only if it occurs free (respectively bound) in either ψ1 or ψ2.
  • if φ = y ψ (or y ψ), then x occurs free in φ if and only if it occurs free in ψ and x is a different symbol than y; x occurs bound in φ if and only if x is y or it occurs bound in ψ.
Closed formula
A formula is closed if and only if no variable occurs free in it.

Semantics

Interpretations

Interpretations in FOL

An interpretation in FOL is a pair (Δ, 𝓘) such that:

  • Δ is a non-empty set called the universe of the interpretation (or domain of discourse);
  • 𝓘 is a function defined on the sets of constants, functions, and predicates such that:

    • for each c ∈ C, 𝓘(c) ∈ Δ;
    • for each n > 0 and each f ∈ Fn, 𝓘(f) : Δn ⟶ Δ;
    • for each n ≥ 0 and each p ∈ Pn, 𝓘(p) : Δn ⟶ {true, false}.

Satisfaction relation

Before defining the satisfaction relation, we need to introduce a new concept, namely assignment:

Variable assignment
Given an interpretation (Δ, 𝓘), a variable assignment (or simply assignment) is a mapping μ : V ⟶ Δ from variables to elements of the universe of interpretation.

For an interpretation (Δ, 𝓘), an assignment μ, a variable x ∈ V, and an element e ∈ Δ of the universe, we use the notation μxe to denote an assignment such that μxe(x) = e and for all y ∈ V\{x}, μxe(y) = μ(y).

Given an interpretation (Δ, 𝓘) and an assignment μ, we can define how every term and formula is interpreted with respect to the assignment as follows:

Given these definition, the Satisfaction relation is defined as follows:

Satisfaction relation in FOL

An interpretation (Δ, 𝓘) in FOL satisfies a formula φ (that is, ((Δ, 𝓘), φ) ∈ ⊨FOL, or (Δ, 𝓘) ⊨FOL φ) if and only if for any assignment μ : V ⟶ Δ, 𝓘[μ](φ) = true.

Properties of FOL

Complexity of FOL
FOL is semi-decidable.
Rewritability to CNF
Given any formula φ, there exists a formula ψ in CNF such that φ ⊨FOL ψ and ψ ⊨FOL φ.
Correspondence between the entailment problem and tautology
For any formulas φ, ψ ∈ ForFOL, φ ⊨FOL ψ if and only if φ → ψ is a tautology.

fol.html: last modified 2020/05/06 14:38:42 by Antoine Zimmermann.