Formalizing first-order logic
Joris Roos
University of Wisconsin-Madison
Sommerakademie Leysin 2018 August 15, 2018
Overview
1 Introduction
2 Syntax
3 Semantics
4 A simple theorem prover
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways: quantifiers: ∀,∃
more complicated atomic formulas, consisting of: variables: x,y,z,· · ·
functions: f(x),g(x,y), .. predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways: quantifiers: ∀,∃
more complicated atomic formulas, consisting of: variables: x,y,z,· · ·
functions: f(x),g(x,y), .. predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of: variables: x,y,z,· · ·
functions: f(x),g(x,y), .. predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of:
variables: x,y,z,· · · functions: f(x),g(x,y), .. predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of:
variables: x,y,z,· · ·
functions: f(x),g(x,y), .. predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of:
variables: x,y,z,· · · functions: f(x),g(x,y), ..
predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of:
variables: x,y,z,· · · functions: f(x),g(x,y), ..
predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”. Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of:
variables: x,y,z,· · · functions: f(x),g(x,y), ..
predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”.
Example. Continuity
∀x.∀ε.ε >0→(∃δ.δ >0→(∀y.|x−y|< δ→ |f(x)−f(y)|< ε))
Introduction
Last time we considered propositional formulas:
((A∨D)→(D∨ ¬B))∧ ¬(A←(B∨C ∧D)
They consist of constants (>,⊥), literals (A,B, . . .), logical connectives and punctuation.
First-order logic (FOL) extends this in two different ways:
quantifiers: ∀,∃
more complicated atomic formulas, consisting of:
variables: x,y,z,· · · functions: f(x),g(x,y), ..
predicates: P(x),x=y,· · · ,
First-order logic is powerful enough to formalize “all of mathematics”.
Example. Continuity
1 Introduction
2 Syntax
3 Semantics
4 A simple theorem prover
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g, . . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false)
Logical operators: ¬,∧,∨ Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g, . . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g, . . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and,
Quantifiers: ∀,∃
Function symbols: f,g, . . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g, . . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g,. . .
Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g,. . . Predicate symbols: P,Q,R,. . .
Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g,. . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g,. . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
Admissible symbols
A FOL formula is a string of symbols from a certain alphabet.
The alphabet consists of
Propositional constants: >(true),⊥(false) Logical operators: ¬,∧,∨
Punctuation: brackets ( ) and, Quantifiers: ∀,∃
Function symbols: f,g,. . . Predicate symbols: P,Q,R,. . . Variable symbols: x,y,z,. . .
We will define FOL formulas in three steps:
terms−→atomic formulas−→formulas
We often also want to fix the allowed function and predicate symbols (this is called a “language”).
FOL language
Definition (Language)
A first-order language(or signature)L is a pair (F,P) where
F is a set of pairs (f,n) with f a function symbol and n a natural number.
P is a set of pairs (P,n) with P a predicate symbol and n a natural number.
The number n is called arityof the predicate or function symbol. A 0-ary function symbol is also called a constant symbol.
Example. Thelanguage of arithmetic is
Larith= ({(0,0),(1,0),(+,2),(∗,2)},{(=,2)}) The language of set theoryis
Lset= ({},{(=,2),(∈,2)})
FOL language
Definition (Language)
A first-order language(or signature)L is a pair (F,P) where
F is a set of pairs (f,n) with f a function symbol and n a natural number.
P is a set of pairs (P,n) with P a predicate symbol and n a natural number.
The number n is called arityof the predicate or function symbol. A 0-ary function symbol is also called a constant symbol.
Example. Thelanguage of arithmetic is
Larith= ({(0,0),(1,0),(+,2),(∗,2)},{(=,2)}) The language of set theoryis
Lset= ({},{(=,2),(∈,2)})
FOL language
Definition (Language)
A first-order language(or signature)L is a pair (F,P) where
F is a set of pairs (f,n) with f a function symbol and n a natural number.
P is a set of pairs (P,n) with P a predicate symbol and n a natural number.
The number n is called arityof the predicate or function symbol. A 0-ary function symbol is also called a constant symbol.
Example. Thelanguage of arithmetic is
Larith= ({(0,0),(1,0),(+,2),(∗,2)},{(=,2)}) The language of set theoryis
Lset= ({},{(=,2),(∈,2)})
FOL language
Definition (Language)
A first-order language(or signature)L is a pair (F,P) where
F is a set of pairs (f,n) with f a function symbol and n a natural number.
P is a set of pairs (P,n) with P a predicate symbol and n a natural number.
The number n is called arityof the predicate or function symbol. A 0-ary function symbol is also called a constant symbol.
Example. Thelanguage of arithmetic is
Larith= ({(0,0),(1,0),(+,2),(∗,2)},{(=,2)}) The language of set theoryis
Lset= ({},{(=,2),(∈,2)})
FOL language
Definition (Language)
A first-order language(or signature)L is a pair (F,P) where
F is a set of pairs (f,n) with f a function symbol and n a natural number.
P is a set of pairs (P,n) with P a predicate symbol and n a natural number.
The number n is called arityof the predicate or function symbol. A 0-ary function symbol is also called a constant symbol.
Example. Thelanguage of arithmetic is
Larith= ({(0,0),(1,0),(+,2),(∗,2)},{(=,2)})
The language of set theoryis
Lset= ({},{(=,2),(∈,2)})
FOL language
Definition (Language)
A first-order language(or signature)L is a pair (F,P) where
F is a set of pairs (f,n) with f a function symbol and n a natural number.
P is a set of pairs (P,n) with P a predicate symbol and n a natural number.
The number n is called arityof the predicate or function symbol. A 0-ary function symbol is also called a constant symbol.
Example. Thelanguage of arithmetic is
Larith= ({(0,0),(1,0),(+,2),(∗,2)},{(=,2)}) The language of set theoryis
Lset= ({},{(=,2),(∈,2)})
Terms
Definition (Term)
The set of terms of a FOL language L= (F,P) is the smallest set (of admissible strings) such that
1 Every variable symbol is a term.
2 IfT1, . . . ,Tn are terms and (f,n)∈F, then f(T1, . . . ,Tn) is a term.
(Ifn= 0 in (2), then the assumption is vacuous, so all constant symbols are terms.)
This is powerful enough to express all algebraic terms commonly used in mathematics.
Example.
(x+y)(x−y) +y∗y is a term of Larith (up to syntax sugar).
Terms
Definition (Term)
The set of terms of a FOL language L= (F,P) is the smallest set (of admissible strings) such that
1 Every variable symbol is a term.
2 IfT1, . . . ,Tn are terms and (f,n)∈F, then f(T1, . . . ,Tn) is a term.
(Ifn= 0 in (2), then the assumption is vacuous, so all constant symbols are terms.)
This is powerful enough to express all algebraic terms commonly used in mathematics.
Example.
(x+y)(x−y) +y∗y is a term of Larith (up to syntax sugar).
Terms
Definition (Term)
The set of terms of a FOL language L= (F,P) is the smallest set (of admissible strings) such that
1 Every variable symbol is a term.
2 IfT1, . . . ,Tn are terms and (f,n)∈F, then f(T1, . . . ,Tn) is a term.
(Ifn= 0 in (2), then the assumption is vacuous, so all constant symbols are terms.)
This is powerful enough to express all algebraic terms commonly used in mathematics.
Example.
(x+y)(x−y) +y∗y is a term of Larith (up to syntax sugar).
Terms
Definition (Term)
The set of terms of a FOL language L= (F,P) is the smallest set (of admissible strings) such that
1 Every variable symbol is a term.
2 IfT1, . . . ,Tn are terms and (f,n)∈F, then f(T1, . . . ,Tn) is a term.
(Ifn= 0 in (2), then the assumption is vacuous, so all constant symbols are terms.)
This is powerful enough to express all algebraic terms commonly used in mathematics.
Example.
(x+y)(x−y) +y∗y is a term of Larith (up to syntax sugar).
Terms
Definition (Term)
The set of terms of a FOL language L= (F,P) is the smallest set (of admissible strings) such that
1 Every variable symbol is a term.
2 IfT1, . . . ,Tn are terms and (f,n)∈F, then f(T1, . . . ,Tn) is a term.
(Ifn= 0 in (2), then the assumption is vacuous, so all constant symbols are terms.)
This is powerful enough to express all algebraic terms commonly used in mathematics.
Example.
(x+y)(x−y) +y∗y is a term of Larith (up to syntax sugar).
Terms
Definition (Term)
The set of terms of a FOL language L= (F,P) is the smallest set (of admissible strings) such that
1 Every variable symbol is a term.
2 IfT1, . . . ,Tn are terms and (f,n)∈F, then f(T1, . . . ,Tn) is a term.
(Ifn= 0 in (2), then the assumption is vacuous, so all constant symbols are terms.)
This is powerful enough to express all algebraic terms commonly used in mathematics.
Example.
(x+y)(x−y) +y∗y is a term of Larith (up to syntax sugar).
Atomic formulas
Definition (Atomic formula)
An atomic formula of a FOL language L= (F,P) is a string of the form P(T1, . . . ,Tn)
where T1, . . . ,Tn are terms of Land (P,n)∈P.
The propositional constants>,⊥ are also atomic formulas.
(Ifn= 0 thenP(T1, . . . ,Tn) is meant to be just the predicate symbolP.)
Example.
(x+y)(x−y) +y∗y = 0 is an atomic formula of Larith (up to syntax sugar). Example.
x ∈y is an atomic formula of Lset.
Atomic formulas
Definition (Atomic formula)
An atomic formula of a FOL language L= (F,P) is a string of the form P(T1, . . . ,Tn)
where T1, . . . ,Tn are terms of Land (P,n)∈P.
The propositional constants>,⊥ are also atomic formulas.
(Ifn= 0 thenP(T1, . . . ,Tn) is meant to be just the predicate symbolP.)
Example.
(x+y)(x−y) +y∗y = 0 is an atomic formula of Larith (up to syntax sugar). Example.
x ∈y is an atomic formula of Lset.
Atomic formulas
Definition (Atomic formula)
An atomic formula of a FOL language L= (F,P) is a string of the form P(T1, . . . ,Tn)
where T1, . . . ,Tn are terms of Land (P,n)∈P.
The propositional constants>,⊥ are also atomic formulas.
(Ifn= 0 thenP(T1, . . . ,Tn) is meant to be just the predicate symbolP.)
Example.
(x+y)(x−y) +y∗y = 0 is an atomic formula of Larith (up to syntax sugar).
Example.
x ∈y is an atomic formula of Lset.
Atomic formulas
Definition (Atomic formula)
An atomic formula of a FOL language L= (F,P) is a string of the form P(T1, . . . ,Tn)
where T1, . . . ,Tn are terms of Land (P,n)∈P.
The propositional constants>,⊥ are also atomic formulas.
(Ifn= 0 thenP(T1, . . . ,Tn) is meant to be just the predicate symbolP.)
Example.
(x+y)(x−y) +y∗y = 0 is an atomic formula of Larith (up to syntax sugar).
Example.
x ∈y is an atomic formula of Lset.
Formulas
Definition (Formula)
The set of formulas of a FOL languageL is the smallest set (of strings of admissible symbols) such that
1 Atomic formulas ofL are formulas.
2 IfF is a formula, then¬F is a formula.
3 IfF,F0 are formulas, then∨(F,F0) and∧(F,F0) are formulas.
4 Ifx is a variable symbol andF is a formula, then∀(x,F) and∃(x,F) are formulas.
Formulas
Definition (Formula)
The set of formulas of a FOL languageL is the smallest set (of strings of admissible symbols) such that
1 Atomic formulas ofLare formulas.
2 IfF is a formula, then¬F is a formula.
3 IfF,F0 are formulas, then∨(F,F0) and∧(F,F0) are formulas.
4 Ifx is a variable symbol andF is a formula, then∀(x,F) and∃(x,F) are formulas.
Formulas
Definition (Formula)
The set of formulas of a FOL languageL is the smallest set (of strings of admissible symbols) such that
1 Atomic formulas ofLare formulas.
2 IfF is a formula, then¬F is a formula.
3 IfF,F0 are formulas, then∨(F,F0) and∧(F,F0) are formulas.
4 Ifx is a variable symbol andF is a formula, then∀(x,F) and∃(x,F) are formulas.
Formulas
Definition (Formula)
The set of formulas of a FOL languageL is the smallest set (of strings of admissible symbols) such that
1 Atomic formulas ofLare formulas.
2 IfF is a formula, then¬F is a formula.
3 IfF,F0 are formulas, then∨(F,F0) and∧(F,F0) are formulas.
4 Ifx is a variable symbol andF is a formula, then∀(x,F) and∃(x,F) are formulas.
Formulas
Definition (Formula)
The set of formulas of a FOL languageL is the smallest set (of strings of admissible symbols) such that
1 Atomic formulas ofLare formulas.
2 IfF is a formula, then¬F is a formula.
3 IfF,F0 are formulas, then∨(F,F0) and∧(F,F0) are formulas.
4 Ifx is a variable symbol andF is a formula, then∀(x,F) and∃(x,F) are formulas.
Syntactic sugar
Example. This is a formula (of a suitable FOL language):
∃(x,∀(y,∧(Q(x),¬P(x,y))))
For readability we prefer to write the formula as follows:
∃x.∀y.Q(x)∧ ¬P(x,y)
This is just syntax sugar! We always keep in mind that the formula
“actually” looks as above.
Syntactic sugar
Example. This is a formula (of a suitable FOL language):
∃(x,∀(y,∧(Q(x),¬P(x,y)))) For readability we prefer to write the formula as follows:
∃x.∀y.Q(x)∧ ¬P(x,y)
This is just syntax sugar! We always keep in mind that the formula
“actually” looks as above.
Syntactic sugar
Example. This is a formula (of a suitable FOL language):
∃(x,∀(y,∧(Q(x),¬P(x,y)))) For readability we prefer to write the formula as follows:
∃x.∀y.Q(x)∧ ¬P(x,y)
This is just syntax sugar! We always keep in mind that the formula
“actually” looks as above.
1 Introduction
2 Syntax
3 Semantics
4 A simple theorem prover
Interpretation
To give meaning to a first-order formula we first need to give meaning to its atomic formulas. This requires the following data:
Definition (Interpretation)
An interpretation M of a FOL language L= (F,P) consists of:
1 a nonempty set D called thedomain,
2 for eachn-ary function (f,n)∈F with n≥1, a function fM :Dn→D,
3 for eachn-ary predicate (P,n)∈P, a function PM :Dn→ {true,false}.
(In the casen= 0,fMis simply a constant inD; similarly,PMis a constant truth value.)
Interpretation
To give meaning to a first-order formula we first need to give meaning to its atomic formulas. This requires the following data:
Definition (Interpretation)
An interpretation M of a FOL language L= (F,P) consists of:
1 a nonempty set D called thedomain,
2 for eachn-ary function (f,n)∈F with n≥1, a function fM :Dn→D,
3 for eachn-ary predicate (P,n)∈P, a function PM :Dn→ {true,false}.
(In the casen= 0,fMis simply a constant inD; similarly,PMis a constant truth value.)
Interpretation
To give meaning to a first-order formula we first need to give meaning to its atomic formulas. This requires the following data:
Definition (Interpretation)
An interpretation M of a FOL language L= (F,P) consists of:
1 a nonempty set D called thedomain,
2 for eachn-ary function (f,n)∈F with n≥1, a function fM :Dn→D,
3 for eachn-ary predicate (P,n)∈P, a function PM :Dn→ {true,false}.
(In the casen= 0,fMis simply a constant inD; similarly,PMis a constant truth value.)
Interpretation
To give meaning to a first-order formula we first need to give meaning to its atomic formulas. This requires the following data:
Definition (Interpretation)
An interpretation M of a FOL language L= (F,P) consists of:
1 a nonempty set D called thedomain,
2 for eachn-ary function (f,n)∈F with n≥1, a function fM :Dn→D,
3 for eachn-ary predicate (P,n)∈P, a function PM :Dn→ {true,false}.
(In the casen= 0,fMis simply a constant inD; similarly,PMis a constant truth value.)
Interpretation
To give meaning to a first-order formula we first need to give meaning to its atomic formulas. This requires the following data:
Definition (Interpretation)
An interpretation M of a FOL language L= (F,P) consists of:
1 a nonempty set D called thedomain,
2 for eachn-ary function (f,n)∈F with n≥1, a function fM :Dn→D,
3 for eachn-ary predicate (P,n)∈P, a function PM :Dn→ {true,false}.
(In the casen= 0,fMis simply a constant inD; similarly,PMis a constant truth value.)
Interpretation
To give meaning to a first-order formula we first need to give meaning to its atomic formulas. This requires the following data:
Definition (Interpretation)
An interpretation M of a FOL language L= (F,P) consists of:
1 a nonempty set D called thedomain,
2 for eachn-ary function (f,n)∈F with n≥1, a function fM :Dn→D,
3 for eachn-ary predicate (P,n)∈P, a function PM :Dn→ {true,false}.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=true iffx =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=true iffx =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=true iffx =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y
We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=true iffx =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=trueiff x =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=trueiff x =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=trueiff x =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=trueiff x =y We call this one Mbool.
The following is also an interpretation:
3 =M (x,y) :=true iffx 6=y Let us call this one Mnonsense.
Examples
An interpretation of Larith is given by arithmetic of natural numbers:
1 D :=N
2 0M := 0, 1M := 1, +M(x,y) :=x+y,∗M(x,y) :=x∗y
3 =M (x,y) :=trueiff x =y We call this one MN.
Another interpretation of Larith is given by boolean arithmetic:
1 D :={0,1}
2 0M := 0, 1M := 1, +M(x,y) :=x+y(mod2),
∗M(x,y) :=x·y(mod2))
3 =M (x,y) :=trueiff x =y We call this one Mbool.
The following is also an interpretation:
1 D :=Z,
2 0M := 7, 1M := 0, +M(x,y) :=x−3y2,∗M(x,y) :=x+y,
3 =M (x,y) :=trueiff x 6=y
Let us call this oneJoris Roos Mnonsense. First-order logic August 15, 2018 13 / 30
Term evaluation
Definition
A valuation v for an interpretationM is a map from the set of variable symbols to the domain D: v(x)∈D for every variable symbolx.
Let M be an interpretation andv a valuation. Then to each termt we assign a value evM,v(t)∈D such that
1 evM,v(x) =v(x) ifx is a variable symbol,
2
evM,v(f(t1, . . . ,tn)) =fM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary function symbol f.
By structural induction this defines a unique map from the set of terms to the domain D.
Term evaluation
Definition
A valuation v for an interpretationM is a map from the set of variable symbols to the domain D: v(x)∈D for every variable symbolx. Let M be an interpretation andv a valuation. Then to each termt we assign a value evM,v(t)∈D such that
1 evM,v(x) =v(x) ifx is a variable symbol,
2
evM,v(f(t1, . . . ,tn)) =fM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary function symbol f.
By structural induction this defines a unique map from the set of terms to the domain D.
Term evaluation
Definition
A valuation v for an interpretationM is a map from the set of variable symbols to the domain D: v(x)∈D for every variable symbolx. Let M be an interpretation andv a valuation. Then to each termt we assign a value evM,v(t)∈D such that
1 evM,v(x) =v(x) ifx is a variable symbol,
2
evM,v(f(t1, . . . ,tn)) =fM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary function symbol f.
By structural induction this defines a unique map from the set of terms to the domain D.
Term evaluation
Definition
A valuation v for an interpretationM is a map from the set of variable symbols to the domain D: v(x)∈D for every variable symbolx. Let M be an interpretation andv a valuation. Then to each termt we assign a value evM,v(t)∈D such that
1 evM,v(x) =v(x) ifx is a variable symbol,
2
evM,v(f(t1, . . . ,tn)) =fM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary function symbol f.
By structural induction this defines a unique map from the set of terms to the domain D.
Term evaluation
Definition
A valuation v for an interpretationM is a map from the set of variable symbols to the domain D: v(x)∈D for every variable symbolx. Let M be an interpretation andv a valuation. Then to each termt we assign a value evM,v(t)∈D such that
1 evM,v(x) =v(x) ifx is a variable symbol,
2
evM,v(f(t1, . . . ,tn)) =fM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary function symbol f.
By structural induction this defines a unique map from the set of terms to
Evaluation of formulas
For each formula F, interpretation M and valuationv we want to define a meaning evM,v(F)∈ {true,false}.
The idea is again structural induction, but there is a catch!
The semantics of the quantifiers require us to modify the assignmentv for the variables bound by a quantifier.
For every variable symbolx and every a∈D we define v[x7→a]
to be the assignment that maps x toa and every y 6=x to v(y).
Evaluation of formulas
For each formula F, interpretation M and valuationv we want to define a meaning evM,v(F)∈ {true,false}.
The idea is again structural induction, but there is a catch!
The semantics of the quantifiers require us to modify the assignmentv for the variables bound by a quantifier.
For every variable symbolx and every a∈D we define v[x7→a]
to be the assignment that maps x toa and every y 6=x to v(y).
Evaluation of formulas
For each formula F, interpretation M and valuationv we want to define a meaning evM,v(F)∈ {true,false}.
The idea is again structural induction, but there is a catch!
The semantics of the quantifiers require us to modify the assignmentv for the variables bound by a quantifier.
For every variable symbolx and every a∈D we define v[x7→a]
to be the assignment that maps x toa and every y 6=x to v(y).
Evaluation of formulas
For each formula F, interpretation M and valuationv we want to define a meaning evM,v(F)∈ {true,false}.
The idea is again structural induction, but there is a catch!
The semantics of the quantifiers require us to modify the assignmentv for the variables bound by a quantifier.
For every variable symbolx and every a∈D we define v[x7→a]
to be the assignment that maps x toa and every y 6=x to v(y).
Evaluation of formulas
For each formula F, interpretation M and valuationv we want to define a meaning evM,v(F)∈ {true,false}.
The idea is again structural induction, but there is a catch!
The semantics of the quantifiers require us to modify the assignmentv for the variables bound by a quantifier.
For every variable symbolx and every a∈D we define v[x7→a]
to be the assignment that maps x toa and every y 6=x to v(y).
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) istrue iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is true iff at least one ofevM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is true iff both,evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable. To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is true iff at least one ofevM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is true iff both,evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable. To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is trueiff at least one of evM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is true iff both,evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable. To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is trueiff at least one of evM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is trueiff both, evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable. To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is trueiff at least one of evM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is trueiff both, evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable. To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is trueiff at least one of evM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is trueiff both, evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable. To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is trueiff at least one of evM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is trueiff both, evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable.
To enable a straightforward computer implementation of the semantics we need to restrict to finite D.
Evaluation of formulas
Now we can run the structural induction:
1 evM,v(P(t1, . . . ,tn)) :=PM(evM,v(t1), . . . ,evM,v(tn)) for every n-ary predicate symbol P.
2 evM,v(¬F) is true iffevM,v(F) isfalse.
3 evM,v(F ∨F0) is trueiff at least one of evM,v(F),evM,v(F0) is true.
4 evM,v(F ∧F0) is trueiff both, evM,v(F) andevM,v(F0) are true.
5 evM,v(∃x.F) is trueiff there exists a∈D such that evM,v[x7→a](F) is true.
6 evM,v(∀x.F) is trueiff for all a∈D,evM,v[x7→a](F) istrue.
Beware: the domainD is nonempty, but otherwise arbitrary (e.g. could be uncountably infinite) and the functions fM,PM need not be computable.
To enable a straightforward computer implementation of the semantics we need to restrict to finite D.