• Keine Ergebnisse gefunden

Formalizing first-order logic

N/A
N/A
Protected

Academic year: 2022

Aktie "Formalizing first-order logic"

Copied!
146
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Formalizing first-order logic

Joris Roos

University of Wisconsin-Madison

Sommerakademie Leysin 2018 August 15, 2018

(2)

Overview

1 Introduction

2 Syntax

3 Semantics

4 A simple theorem prover

(3)

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)|< ε))

(4)

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)|< ε))

(5)

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)|< ε))

(6)

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)|< ε))

(7)

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)|< ε))

(8)

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)|< ε))

(9)

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)|< ε))

(10)

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)|< ε))

(11)

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

(12)

1 Introduction

2 Syntax

3 Semantics

4 A simple theorem prover

(13)

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”).

(14)

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”).

(15)

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”).

(16)

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”).

(17)

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”).

(18)

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”).

(19)

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”).

(20)

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”).

(21)

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”).

(22)

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”).

(23)

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)})

(24)

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)})

(25)

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)})

(26)

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)})

(27)

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)})

(28)

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)})

(29)

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).

(30)

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).

(31)

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).

(32)

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).

(33)

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).

(34)

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).

(35)

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.

(36)

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.

(37)

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.

(38)

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.

(39)

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.

(40)

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.

(41)

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.

(42)

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.

(43)

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.

(44)

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.

(45)

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.

(46)

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.

(47)

1 Introduction

2 Syntax

3 Semantics

4 A simple theorem prover

(48)

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.)

(49)

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.)

(50)

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.)

(51)

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.)

(52)

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.)

(53)

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}.

(54)

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.

(55)

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.

(56)

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.

(57)

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.

(58)

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.

(59)

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.

(60)

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.

(61)

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.

(62)

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.

(63)

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.

(64)

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.

(65)

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.

(66)

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

(67)

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.

(68)

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.

(69)

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.

(70)

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.

(71)

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

(72)

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).

(73)

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).

(74)

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).

(75)

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).

(76)

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).

(77)

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.

(78)

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.

(79)

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.

(80)

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.

(81)

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.

(82)

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.

(83)

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.

(84)

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.

Referenzen

ÄHNLICHE DOKUMENTE

We show that the reflection principle is equivalent to rrs 2 , a strengthened version of Aczel’s relation reflection scheme. As applications, we give a new proof that

Let me resume our focal thesis: According to the intentional conception of contents a subject’s belief system has addresses or file cards or discourse

I Propositional formulas combine atomic formulas with ¬, ∧, ∨, → to more complex statements. I Interpretations determine which atomic formulas are true and which ones

Helmert (University of Basel) Foundations of Artificial Intelligence April 26, 2021 2 / 19.. Propositional

31.2 Systematic Search: DPLL 31.3 DPLL on Horn Formulas 31.4 Summary.. Helmert (University of Basel) Foundations of Artificial Intelligence April 26, 2021 2

the number of unsatisfied clauses are possible in Walksat smaller risk of getting stuck in local

Sch¨ oning: Logik f¨ ur Informatiker Picture courtesy of graur razvan ionut / FreeDigitalPhotos.net?. Gabriele R¨ oger (University of Basel) Theory of Computer Science February 25,

I For this purpose, we will use propositional logic, which allows expressing information about 2 n states as logical formulas over n state variables. Transition Systems