Chapter 5

First-Order Logic (FOL) or Predicate Logic (PL1, PC1)

In Aristotle’s syllogistic, every statement consists of the attribution of a property to an object, which means that they are expressed using unary predicates and therefore formalized using PL. This is no longer sufficient when we need to consider relations (binary, ternary, etc.) between objects. These relations cannot be reduced to unary relations (properties)1.

Handling properties and relations is of course essential in programming (logic programming, multi-agent programming, etc.)2.

If we believe we can manage using formalizations, such as those after definition 2.8, how can we talk about objects that have properties P,Q,… or that are related to other objects?

For example, how can we use PL to verify that the following reasoning is correct:

All horses are animals.

Some horses are white.

Therefore, some white horses are animals.

Similarly, how can the following reasoning, which should obviously be correct, be translated into PL?

For all x, xRa, therefore there exists an x such that aRx

If we denote by P: For all x, xRa

and:

Q: there exists x such that aRx

this reasoning would be classified as incorrect (P can be evaluated to true and Q to false).

This reasoning can be formalized as follows: (as you already know, see also definition 5.1).

image

and now “we can see” that it is correct.

The soundness of these reasonings is based on the relation between “for all” (or “all”) and “there exists” (or “some”).

Another very familiar example is that of transitivity: for any objects named x, y, and 2, if x is related to y and y is related to z then x is related to z. Obviously, these sentences cannot be expressed in PL in order to be used in a reasoning. They could be denoted by P (or Q,…), but that would not be very useful.

One last example: how can the following sentence be translated in PL?

The object named 0 satisfies property P, and if an object x satisfies P, then the successor of x also satisfies P…

It is worth mentioning that in finite universes, it is possible to stay within PL. For example, the argumentation if all men are mortal and a given object satisfies the property of being a man, then this object is mortal (see also example 5.9) could be specified with the following propositional schema in a universe with n men:

image

image

where the prepositional symbols Hi and Mi, respectively, denote i is a man and i is mortal.

This way of proceeding is not very natural, it is theoretically limited to finite universes and practically limited by the size of these universes; more importantly, it prevents the usage of variables (because all cases have to be enumerated).

We are currently talking about the limits of the expressive power of a language (and how they can be overcome). As can be expected, once more things can be expressed, there is a risk of not being able to answer all questions on wffs of this language with more expressive power.

In computer science, it is well-known that if we use a language that forbids some control structures, then the halting problem becomes decidable for programs written in this language.

From the point of view of decidability: the fragment of FOL called monadic logic is decidable (see section 5.8). As soon as predicates with an arity greater than or equal to 2 are allowed, we obtain undecidable fragments.

REMARK 5.1.- The language of FOL was introduced by G. Frege in 1879, but the notations that are currently used are similar to those introduced by Peano in 1889. Formal systems were introduced by Hilbert and Ackermann in 1928 (see also remark 5.21).

5.1. Syntax

DEFINITION 5.1.- (FOL language). Consider a signature ieq, where:

ieq is a set of variables;

ieq is a set of function symbols, ni: arity (ni ≥ 0).

Function symbols of arity 0 are constants, and the set of constants is denoted by image (imageimage);

ieq set of predicate symbols, ki: arity (ki ≥ 1);

equ

The language (i.e. the set of wffs) of FOL, denoted by image, is the smallest set such that:

– if ieq (see definition 4.1), then: ieq image is an atomic formula;

– a literal is an atomic formula or its negation;

– if ieq and ieq and ieq, then:

equ

(we will also write ieq);

ieq are called the universal quantifier and existential quantifier, respectively, and x is the quantified variable. A variable will not be quantified more than once (that would make no sense);

– in ieq, ieq is the scope of the quantifiers.;

the set ieq is the set of logical symbols or logical constants;

– the set ieq is the set of non-logical symbols corresponding to the considered theory;

– if the signature does not contain any functional symbol of arity ieq or the predicate symbol =, then we have pure FOL;

– a wff can be viewed as a string (or word) on vocabulary Ω (i.e. a finite sequence of symbols in Ω). A subformula of a wff ieq is a substring3 of ieq (considered as a string), which is also a wff;

– a wff is in nnf if it is constructed with literals, the connectivesand ∨, and the quantifiersand4. Every wff can be transformed into another one that is equivalent and in nnf.

REMARK 5.2.– (the set of wffs of FOL is denumerably infinite). As the set of variables is denumerably infinite, the set of logical symbols finite and the set of non-logical symbols denumerably infinite, it is simple to design an algorithm that enumerates all the wffs using the rules of definition 5.1.

Every infinite set of wffs of FOL will therefore be denumerably infinite (as it will be the subset of a denumerably infinite set).

DIGRESSION 5.1.– In discrete mathematics, researchers use the terminology Boolean predicates or constraints on Boolean variables.

The arity is the number of variables that occur in the constraints.

DIGRESSION 5.2.– (variables 2)5. It is interesting to have a historical recollection here on mathematical notations and, in particular, on the notion of a variable.

Letters were used in Antiquity to denote points, lines, etc. in a generic way, meaning that letters were used as names.

In arithmetic, symbolic abbreviations are very ancient, they were already used by Egyptians.

Diophantus (circa 3rd Century) introduced a particular symbol for the unknowns in algebra, and this seems to be the very first appearance of what would become a numerical variable in mathematics.

It is acknowledged that the first symbolic algebraic language is due to François Viète (1540-1603). Viète used letters to represent unknowns, powers of the unknowns and undetermined coefficients (generic names).

Descartes, Newton, Leibniz, Euler, etc. changed and modified the language introduced by Viète.

In mathematical logic, the concept of a variable was explicitly used by G. Frege.

DEFINITION 5.2.– (free and bound variables). The occurrence of a variable x in a wff of image is bound iff x appears immediately after a quantifier, or if x is in the scope of a quantifier (and has the same name as the quantified variable). Every other occurrence is free.

Below, ieq and ieq denote wffs of ieq.

Set of free variables in a formula:

Free_varsieq (see definition4.2)

Free_varsequ = Free_varsimage

Free_varsequ = Free_varsimage = Free_varsimage = Free_varsimage = Free_varsimage Free_varsimage

Free_varsequ = Free_varsimage = Free_varsimage

Set of bound variables in a formula:

Bound_varsequ

Bound_varsequ = Bound_varsimage

Bound_varsequ = Bound_varsequ = Bound_varsequ = Bound_varsequ = Bound_varsequ Bound_varsequ

Bound_varsequ = Bound_varsequ = Bound_varsequ

REMARK 5.3.– The same variable may have free and bound occurrences in a formula, for example, in formula

equ

The first occurrence of x is free, the second and third are bound.

The first and second occurrences of y are bound, the third is free.

DEFINITION 5.3.– (closed and open formulas). A wff is closed, written closed wff (cwff) iff it does not contain any free variable. Otherwise, it is open and written open wff(owff).

REMARK 5.4.– A bound variable is a variable such that the wff it appears in has a meaning that is independent of this variable. For example, in:

equ

x is bound and y is free.

In programming languages, local variables are bound, global variables are free.

See remark 5.9 on the conceptual difference between a cwff and an owff.

EXAMPLE 5.1.– (translation into FOL). Consider the statement:

Someone who loves all animals loves all men

that we restate as a reasoning, by formulating all the implicit knowledge. There are two “natural” translations, depending on whether “someone” is translated into:

i) animal (not necessarily human) or

ii) human

i.e. respectively:

Given that every human is also an animal, and that there exists an animal that loves all animals, there exists an animal that loves all men.

Given that every human is also an animal and that there exists a human who loves all animals, there exists a human who loves all men.

We translate both versions by introducing the following predicates:

A(x): x is an animal;

H(x): x is a human;

C(x): that must be replaced by A(x) (case i)), or by H(x) (case ii)).

The reasoning is represented as follows in FOL:

equ

5.2. Semantics

The concepts of interpretation, model, and semantics that we will define are, similar to the concept of meaning in natural language, extremely subtle and deserve some thoughts before providing a formal definition (in FoL).

The notion of a model is essential in logic, computer science, and science generally speaking. It is generally used for many different notions, which is why it is said to be polysemous.

On the general notion of a model

Etymologically:

model → muid → “to prescribe something with authority”.

The word “model” appeared during the 16th Century, meaning measure, musical measure, melody, or way of behaving.

The term is used in different ways in everyday language and in scientific papers. one of the few that can be found in the literature is:

X is a model of Y only if X and Y have the same structure or similar structures.

(This could translate into the existence of a morphism between X and Y)

We can distinguish two meanings that cover many usages:

– representation meant to account for a part of reality that was observed. In general, simplifying hypotheses are allowed, such as idealizations, etc.

A problem that arises involves the limits of the validity of the model, i.e. how can we be sure that all inferences (see Chapter 8) made on the model reflect reality?

A key problem is that of distinguishing between pertinent properties and those that can be discarded. This is of the utmost importance when modeling complex systems, where all the parameters are not well known. Recall the caution of scientists about global warming (models are still not satisfactory).

An example in computer science is that of models of computation, such as, computable functions, Turing machines, lambda calculus, Markov algorithms, DNA computing, and quantum computing;

– the one made in mathematical logic. To provide a model of a logical formula means to give an interpretation of the non-logical symbols (i.e. the constant symbols, functions, and predicates) that permits us to make the formula true.

Note that this notion of a model can also be applied to the axioms of an empirical theory: we can test “real” configurations of the axiomatization of the theory.

This point of view can be useful (as it is in mathematics) to verify that the axioms of the theory are not contradictory: a model from the logical point of view is a possible realization.

A standard method to better grasp a notion for which there is no formal definition (or a definition that is unanimously accepted) is to enumerate the different ways it is used. This is what we do now.

Some differences in the ways the term is used are clear. There is a clear difference between a scale model or blueprint (bridge, etc.) and a mathematical model of the economy, atom, DNA, and kinetic theory.

Two remarks:

– the design of a model is the basis of any scientific activity in natural science. The goal is to select all (and only) those properties, factors, parameters, etc., that are supposed to be pertinent for the studied phenomena;

– the distinction between a theory and a model is not always clear. In general, a model is considered as a step toward a theory.

The notion of a morphism that we mentioned above can be better understood by considering phenomena that are (essentially) described by the same formulas: oscillation of a circuit or a pendulum, flow of a liquid or flow of an electric charge, etc.

Models can have different functions.

For example, in biology, models can have a normative function (see the etymology of the word model at the beginning of this section) to organize data. The capital role here is to classify valid inferences (meaning putting information in a usable form (see Chapter 8 for the definition of this term).

It can also be explanatory (in physics, medicine, etc.) or educational (such as in science popularization TV shows), prospective (social sciences, ecology, etc.), heuristic (computer science, biology, etc.), descriptive (simulation), etc.

On the importance of the notion of a model in science, we quote an opinion of one of the greatest mathematicians of the 20th Century (S. Mac Lane):

…the sciences do not try to explain, they hardly try to interpret, they mainly make models…The justification (of a model) is solely and precisely that it is expected to work …Furthermore, it must satisfy certain aesthetic criteria – that is, in relation to how much it describes, it must be simple.

5.2.1. The notions of truth and satisfaction

What is truth?

Pilate (Gospel according to John, 18:38)

What I say three times is true

L. Carrol (The Hunting of the Snark)

The notion of semantics (with the meaning of study of a language, i.e. its words and statements from the point of view of their meaning) is very difficult to specify, and our intuition seems to associate it with the notion of translation.

The notions of true and false are closely related to that of meaning.

To give a characterization of the notion of truth is an old problem of philosophy and logic6.

As Tarski noticed, the word truth and those derived from it are used in everyday language in different domains: psychology (for example, “Does Ann really love Bernard?”), aesthetism (for example, “Is this book really a masterpiece?”), moral (for example, “Why isn’t this politician telling the truth?”), religion (for example, “Did this miracle really happen?”), etc.

For some, statements are the vehicles of veracity or falsity, for others, meanings are.

Once we agree on this, there remains to decide how to assign them with a truth value (or what their truth value is).

There is, however, a large consensus on the following: what is true or false7 are the propositions (see definition 3.1).

A great philosopher (and logician) said it this way: “The eternal statements (i.e. independent from time8) are what I consider essentially as vehicles of truth”.

But what does the truth of these statements consist in? They qualify as true (according to Tarski) depending on reality.

“Snow is white” iff snow is white (in other words, truth is disquotation).

The truth predicate is an in-between, between words and statements and the real world. What is true is the statement, but its truth holds because the world is as it states.

By analyzing paradoxes, we can conclude that the truth predicate is incoherent, unless it is somehow restricted (there exists a theorem by Tarski on the undefinability of truth).

Basically, the problem is solved by putting a hierarchy in place, (similar to what was done in set theory): true0 disquotes all statements without any truth predicate; true1 disquotes all statements without any truth predicate above true0… and so on.

Here, we restrict ourselves to the notion of truth in axiomatic systems (mathematical logic) about (well-formed) formulas of a formal language.

Before proceeding with the formalization, a question arises naturally: “What criteria should be satisfied by a suitable definition of truth?”

A. Tarski gave the following three criteria:

1) Meta-language: if L is the object language (working language), then the definition of truth must be given in a meta-language M with LM, M must globally be capable of expressing “more things” than L. If L is capable of expressing facts about its own semantics, then we easily obtain paradoxes such as the liar’s paradox.

M contains a unary predicate True whose intended meaning is: True(prop): proposition prop is true;

2) Formal correction: predicate True must be of the form (or in a form provably equivalent to):

equ

If an equivalent form is used, the equivalence must be proved using the axioms of M, but it must not use the predicate True;

3) Material adequation: the objects that satisfy definition (*) in (2) must be exactly those that are intuitively true propositions in L, and this must be proved using the axioms of M.

To avoid problems related to the definition of truth, Tarski introduced the satisfaction relation (see definition 5.6). The key to avoiding problems is that the definition of satisfaction is inductive (it is said to be compositional): we begin with the satisfaction of atomic statements, then the satisfaction of statements of a higher complexity is defined in terms of that of their components (the idea of a hierarchy can be found here too). Truth only deals with closed statements (which do not contain free variables). The analog to truth for open statements is satisfaction. An assignment of objects satisfies a statement if the latter is true for the values given to the free variables9. The notion of satisfaction does not permit us to translate, for example, “not (x satisfies x)” (“x” denotes a variable).

To get a better grasp of the idea behind the formal definition, we first give a few informal definitions.

EXAMPLE 5.2.– We consider a “formal system” (see definition 3.9)10 ieq

where:

ieq: English language;

ieq: the “usual” rules of mathematics;

ieq:

let K and L be two sets

A1): every element of L contains exactly two elements of K.

A2): no element of K is contained in more than two elements of L.

A3): no element of L contains all the elements of K.

A4): the intersection of any two (distinct) elements of L contains exactly one element of K.

A possible model, interpretation, and meaning of these axioms (that also shows that these axioms are not contradictory) is:

image

(this model can be viewed as a triangle with the (non-collinear) vertices A, B, C).

EXAMLPLE 5.3.– (Z. Manna and R. Waldinger). When learning algorithm, it turns out that program schemas frequently occur in different problems.

Consider the following schema, for which we will produce different interpretations.

 

program X;

begin

read (x) ;% x is a variable

y1x ;

y2a ; % a is a constant

while ¬P(y1)

do

y2g(y1, y2) ;

y1f(y1) ;

enddo

zy2 % z contains the result

end

Interpretation 1

D (considered universe): image

a: 1

f(y1): y1 − 1

g(y1,y2): y1 × y2

P(y1): y1 =0

The program represents factorial (x)

Interpretation 2

   D (considered universe): lists

   a: nil

   f(y1): cdr(y1) %, i.e. list y1 without its first element

   g(y1,y2): cons(car(y1),y2) %, i.e. the list obtained by putting the first element of y1 instead of that of y2

   P(y1): null(y1) % null(y): y is an empty list

 

The program represents reverse (x)

Interpretation 3

   D (considered universe): ieq

   a: 0

   f (y1): y1 - 1

   g(y1,y2): y1 + y2

   P(y1): y1 = 0

 

The program represents the sum of the first x natural numbers.

EXAMPLE 5.4.– Consider the following wffs:

a) ∀xP(x, x) ∧ (∀yz((P(x, y) ∧ P(y, z)) ⇒ P(x, z))) ∧ ∃wP(x,w))

    This could express (for example): no natural number is less than itself, the relation “less than” is transitive and there always exists a natural number that is greater than a given natural number.

b) ∀yxP(x, y)

    This could express (for example): every integer is greater than some other integer.

c) ∀yxP(x, y)

    We could say this is false if we consider natural numbers and P represents the relation “less than”.

d) ∀x¬D(a, x)

    This could express (for example): 0 does not divide any integer.

e) ∀xP(f(x))

    This could express (for example): the square of any integer is positive.

f) ∀xy(P(x, y) ⇒ P(x, y))

    This could express (for example): for any relation we could imagine that is represented by P, this wff is true.

g) ∃xy¬(P(x, y) ⇒ P(x, y))

    This could express: for any relation we could imagine that is represented by P, this wff is false.

    Consider the following wff:

h) ∀xyP(x, y)

    is it true or false? The (correct) answer that seems the most natural is, it depends. Indeed, if the formula is interpreted on ieq and P(x, y) represents the relation xy, then it is true. If P(x, y) represents x > y, then it is false.

i) ∀xy(P(x, y) ∧ ∀w(P(y,w) ⇒ y = w))

This could represent: if the values of variables x, y and w are instants and P(x, y) denotes the relation xy between these instants, the formula expresses that there will be an end of time.

DEFINITION 5.4.Given a first-order language ieq (see definition 5.1), a first-order structure or structure ieq is a triplet:

ieq

where:

D is a non-empty set called the domain or universe of discourse

equ

set of functions:

equ

set of relations:

equ

where the ieq's (in particular, the constants) and the ieq's, respectively, correspond to the functional symbols and the predicates in ieq.

Two particular cases:

ieq

EXAMPLE 5.5.–

ieq

DIGRESSION 5.3.– When searching for interpretations of wffs or sets of wffs, it is often the case that different interpretations are “globally” the same.

More precisely, to each element of one domain corresponds an element of the other domain with the same properties and conversely.

This feature is formalized in the following definition.

DEFINITION 5.5.– (structure isomorphism). Given two structures ieq and ieq:

equ

a bijectionieq

is a structure isomorphism iff

(the exponents ieq and ieq identify the structure the objects belong to)

for every constant c in the signature of ieq:

equ

-for every n-tuple ieq and every n-ary functional symbol f(n) in the signature of image:

equ

for every n-tuple ieq and every n-ary predicate symbol P(n) in the signature of ieq:

equ

ieq and ieq are said to be isomorphic.

REMARK 5.5.– The idea behind the following definition is the same as the one that we used informally and intuitively in the examples, i.e. given a first-order language (or wff), we fix a universe D, to each constant in the wff we associate an element of D, to each functional symbol of arity n, a total function (meaning that it is defined everywhere on D) of arity n on D, and to each predicate symbol of arity k, a relation of arity k on D. Variables “go through” D, and ∀ and ∃ are interpreted as usual, i.e. “for all” and “there exists (at least one),” respectively. The semantics (meaning) of the wff is given by that of the functions and relations on the chosen universe, which are assumed to be known.

 

A cwff is T or F in an interpretation. The evaluation of the cwff is carried out in the structure and the variables get their values in the universe of discourse. It is, therefore, not necessary to add to the language expressions of the form “for every x in D”. The language is independent of the formalization of set theory.

DEFINITION 5.6.– (interpretation, satisfaction). Let ieq denote a first-order language and ieq a structure.

An fp-assignment (f stands for “function” and p stands for “predicate”) is a function afp satisfying the following:

i) for every predicate symbol ieq is a relation ieq of ieq;

ii) for every function symbol ieq:

ieq is a (total) function ieq

for constants:

ieq

a υ-assignment is a function:

ieq

where image denotes the set of variables of ieq.

For terms (see definition 4.1) we define the t-assignment at as follows:

iii) if image then at(t) = av(t);

iv) if image then at(t) = afp(t);

v) otherwise, ieq.

An interpretation of the language ieq (or of a wff of ieq) is an fp, v, and t-assignment.

A satisfaction relation:

ieq (which reads as “Formula image is satisfied in structure ieq with interpretation ieq”)

is defined as follows:

1) ieq

2) ieq iff not image %, i.e. logic with two truth values

3) ieq and image

4) ieq or image

5) ieq or image

6) ieq and image

7) ieq see section 9.1

8) ieq iff there exist a image such that image

9) ieq iff for all image

ieq coincides with ieq except for av(x)

REMARK 5.6.– Warning: not (ieq) is not equivalent to ieq.

See section 3.1.1 and remark 3.5. The negation of “for all” is not “for all not”.

REMARK 5.7.– (on the domain of discourse). In the definition of the semantics for FOL, the only constraint on the domain of discourse is that it is non-empty. We can therefore choose the domain of discourse to be a set of closed terms. This remark will be useful in the proof of theorem 5.4.

EXAMPLE 5.6.– The wff

equ

denotes in what is called Presburger arithmetic, i.e. the theory of the structure:

equ

“There are infinitely many even numbers”.

This theory is decidable, but the decision procedure has a superexponential complexity (22n).

DEFINITION 5.7.– A wff φ is valid iff it is satisfied in every interpretation on every structure. This is denoted by ieq.

A structure ieq is a model of a set of wffs S iff there exists ieq such that ieq for all ieq.

REMARK 5.8.– (models: another theory). A model of an axiomatic theory is a set of objects chosen from another theory: the one in which the objects assigned to those of the former are supposed to have a meaning “by themselves” (for example, sets, functions, and relations) and satisfying the axioms.

REMARK 5.9.– (open and closed formulas).

– A cwff denotes a truth value. For example, ∀xyP(x, y) denotes true in ieq, if P represents <.

– An owff denotes a set, i.e. the set of values that make it true. For example, Prime(x) denotes all prime numbers.

– Owffs are used to define classes (sets) (see digression 2.2), for example, the set {x | Prime(x)}.

– Free variables, and therefore owffs, occur very frequently in informal mathematics, in expressions such as:

i) Let x denote a natural number

or :

ii) Let x denote a natural number such that…

In (i) they are given a universal interpretation (i.e. for all x).

In (ii) they are given a conditional interpretation (i.e. for some particular x’s).

When these expressions (or rather their formalizations) are involved in reasonings, they will be treated, as is customary, as universally quantified variables. Indeed, when no particular conditions are imposed on x, this is equivalent to saying for any x, or for all x.

EXAMPLE 5.7.– (set of prime numbers). The set of prime numbers in ieq can be defined as follows:

equ.gif.

When a condition is imposed on x, this is equivalent to saying for all x satisfying this condition (condition that will be translated in the formula)11.

– For the owffs that occur in reasonings, we shall use their closure, which is defined by:

equ

(where Free_varsieq)

EXERCISE 5.1.– (A model is finite (respectively, infinite) if the cardinality of its universe of discourse is finite (respectively, infinite).

a) Give a model of:

equ

b) Give a model and a counter model of:

equ

c) Give a model of:

equ

d) Give a model of:

equ

e) Give a model of:

equ

f) Give a counter model of:

equ

g) Give a model and a counter model of:

equ

h) Is the wff:

equ

valid?

i) Give a model of the following formula that is independent of the selected domain of discourse.

   In other words, give an interpretation of the predicate P such that for any domain, it corresponds to a model of the given formula:

equ

j) Given the wff:

equ

j1) give a model of this formula with domain D = ieq (i.e. an infinite model);

j2) give a model of this formula with domain D = {1, 2} (i.e. a finite domain);

j3) give a counter model of this formula with domain D = ieq.

k) Can you construct:

k1) a finite model for the following formula?

equ

k2) an uncountably infinite model?

k3) a denumerably infinite model?

1) Give a model and a counter model of:

equ

m) Can you construct:

m1) an infinite model for the formula:

equ

m2) a finite model?

n) Can you construct a finite model for the formula:

equ

i.e. a function f : DD that is one-to-one but not onto.

o) Given the formulas (1), (2), and (3) below, show that (3) is not a logical consequence of (1) and (2) (in other words, the commutativity of + cannot be deduced from (1) and (2))

1) image

2) image

3) image

0 denotes a constant, x and y variables and s a functional symbol.

p) Can you construct a model for the set of formulas below?

equ

a denotes a constant, x and y variables, and f, s, and p functional symbols.

5.2.2. A variant: multi-sorted structures

In section 5.2.1, it was mentionned that it was not necessary to specify what domain a variable can get its values from in a formula.

However, it is common in practice to want to identify these domains (sets that are named sorts), in particular, when different variables can get their values from domains of different types (for example, scalars and vectors in vector spaces).

5.2.2.1. Expressive power, sort reduction

We may wonder whether using sorts increases the expressive power of FOL, i.e. if more things can be expressed with sorts than without or if this is simply syntactic sugar. The answer is that the expressive power of FoL with sorts is the same as that of FoL, and this result is proved using the so-called sort reduction technique.

equ

– The signature is extended with predicates PD and PE.

– We consider the structure

ieq

where RD = D, RE = E (RD and RE, are unary relations, i.e. subsets of D and E, respectively) and:

afp(PD) = RD and afp(PE) = RE (see definition 5.6).

– Hence, if sorts were used to write formulas, it suffices to replace (as usual, F [x] means that variable x occurs in wff F):

ieq

REMARK 5.10.– (theory, closed theory, and complete theory). In definition 3.9, we defined the notion of a formal theory. Here, we introduce the notion of a theory, along with essential definitions and properties of theories, that deal with semantics.

– Once the notion of consequence has been introduced (see definitions 2.4 and 2.6, it can be syntactic or semantic), a theory is closed iff it is closed by the consequence relation (according to Gödel’s completeness theorem, see remark 5.21, we can use lperp.gif or ieq).

–A theory T is complete (in ieq) iff the set of its consequences is maximal consistent (i.e. if it is consistent and none of its supersets is consistent).

– A set of axioms of a theory T is a set of cwff with the same set of consequences as T. T is a set of axioms of T and ∅ is a set of axioms of T iff T is the set of valid cwffs of ieq (from a semantical point of view). T is finitely axiomatizable iff it is axiomatizable by a finite set of axioms.

– (See remark 3.15) The standard way of specifying a theory is to provide a set of axioms that define it.

Here is another way of proceeding: given a structure ieq and an interpretation ieq of ieq, the theory ieq is the set of all cwffs F of ieq such that ieq Theory ieq is complete.

– A theory T is complete iff for all cwffs F, either T image F or T ieq ¬F. % This is to be compared with the notion of completeness for a formal system (definition 3.12).

Given a theory T, statements 1 to 4 below are equivalent:

1) the set of consequences of T is maximal consistent;

2) T is complete (i.e. for all cwffs F, either T image F or T image ¬F);

3) T has exactly one model;

4) there exists a model ieq such that for all cwffs F, T ieq F iff image ieq F.

5.2.3. Theories and their models

Two isomorphic structures (see definition 5.5) do not differ on anything essential.

The following theorem confirms this intuition and shows that FOL does not permit us to distinguish between two isomorphic structures.

THEOREM 5.1.– (structure discrimination). Let ieq1 and ieq2 denote two isomorphic structures. Then, for all wffs F of FOL,

equ

PROOF.– (intuition). By structural induction (i.e. for all objects introduced by the inductive definition of wffs, see definition 5.1).

It is legitimate to wonder whether the converse is also a theorem.

The negative answer to this question is given by the following theorem:

THEOREM 5.2.– (non-standard model). There exists a set of formulas S of FOL that admits the structures ieq and ieq as models (see the definition below), where ieq1 and ieq2 are not isomorphic (example given by Crossley et al.).

 

PROOF.– Consider the following set of formulas (we indicate as a comment, i.e. a line preceded by %, the desired interpretation of predicate P):

image

It is simple to check that:

ieq (where image denotes the usual order relation in image) is a model of S.

Now consider the following sets:

equ

and the structure ieq (where image denotes the usual order relation in image).

It is simple to verify that this is also a model of S.

But ieq1 and ieq2 are not isomorphic structures, as can be verified by taking an element of D, for example,ieq (or image or ieq, etc.), which has an infinity of predecessors, which is not the case for any element of image (see digression 5.3 and definition 5.5).

ieq2 is called a non-standard model because it is not isomorphic to the intended model ieq1, which is called the standard model.12 Note that Peano’s axioms are categorical in second-order logic (SOL).

5.2.3.1. How can we reason in FOL?

Similar to what was done in PL, we can provide a syntactical approach (with a formal system) or a semantical approach (based on interpretations). We shall give priority to the latter.

Actually, the methods will be obtained thanks to semantic notions, but similar to what was done, for example, for resolution in PL, the goal is to obtain a deductive system.

For the syntactical approach, see remark 5.21.

5.3. Semantic tableaux in FOL

It is obtained by reduction to the method of semantic tableaux in PL.

There are two fundamental differences compared to the method studied for PL (these differences are inherent to FOL):

– the quantifiers ieq and ieq may occur;

– the method may not halt (FOL is undecidable).

The way we proceed is basically intuitive and is based on the same ideas as the corresponding formal system.

The Lowenheim-Skolem theorem (theorem 5.4) ensures that it is possible to restrict the search for models of FOL formulas to denumerable domains.

From now on, we therefore restrict ourselves to denumerable universes (interpretations and models), which are the only ones that can be handled in computer science.

This enables us to solve the problem of handling quantifiers. On a denumerable universe

equ

ieq and ieq correspond to:

equ

(these are not wffs of FOL, but an informal way of stating things).

There are two important questions that need to be asked:

– when variables are replaced by elements of the domain D, what we obtain is generally not a wff of FOL (see definition 5.1). However, intuition, together with the habits of mathematical practice, suggest that “this does not matter”. Indeed, in mathematical practice, it is not necessary to declare signatures, and symbols are introduced when they are needed. Furthermore, in general, the domain of discourse (semantical point of view) shall be described using a set of symbols that is disjoint from the one used to write formulas (syntactic point of view). We can therefore assume that, each time we are searching for models of FOL formulas (or proving that they do not have any), we have at our disposal a denumerably infinite set of parameters, denoted by Par (where Parieq, see definition 5.1), that will replace the variables occurring in formulas and will also denote the values of closed terms;

– the second key point is that, in the proof of the Löwenheim-Skolem theorem (theorem 5.4), we assume that the considered formula F is in Skolem normal form (written sk(F)), i.e. in a form that is not necessary to treat the formula with the method of semantic tableaux.

A capital operation to obtain sk(F) is the elimination of existential quantifiers by Skolemization. When replacing ∀xyP(x, y) by ∀xP(x, f(x)), Skolemization introduces a function f (which is not defined, but whose existence is guaranteed by the AC). This function can be replaced by its graph with domain and codomain Par, meaning that ∀xyP(x, y) will be replaced by P(a1, a2), P(a1, a2),…

Using an argument similar to the one that occurs in the proof of the Lowenheim– Skolem theorem, we could think: if the formula ∀xyP(x, y) has a model image with uncountably infinite domain D, this means (see definition 5.6) that for all xD, there exists xD such that ieq (where ieq is the relation assigned to P in the model). But if this is true for all xD, it must also hold for a denumerable subset of D, and, in particular, up to a renaming, on the domain Par; see also section 5.4.

A similar reasoning applies to formulas that are exclusively quantified with ∀’s.

We shall use the following equivalent formulas (not doing so can lead to errors; see exercise 5.3):

ieq

where ieq

as well as:

ieq

where ieq denotes a wff.

REMARK 5.11.– The last four rules are frequently used. For example, to express that function f is not injective:

ieq

ieq

is equivalent to:

ieq

which is equivalent to:      ieq

ieq

which is equivalent to:

ieq

The rules to use for the method of semantic tableaux in FOL are those of section 3.2, together with the equivalent formulas above and the rules of Figure 5.1.

Figure 5.1. Rules for semantic tableaux (FOL)

Figure 5.1

REMARK 5.12.– It should be clear that, although they are syntactically different from propositions (base formulas), atomic formulas such as P(a1) where a1 is a constant, correspond to the definition of propositions and it is correct to consider them as such. Atomic formulas such as P(x) are often called propositional functions.

To illustrate the ideas, recall H(x) (x is a man). It cannot be evaluated as long as the value of x is not known. This is not the case for H(a) (Socrates is a man) or H(b) (The mother of Socrates is a man).

As for PL, a branch will be closed once an elementary contradiction has been detected (for example, of the form P(a), ¬P(a)), and those are the only ones that can be detected syntactically (i.e. mechanically).

REMARK 5.13.– The procedure semantic tableaux (FOL) is non-deterministic, in other words, choices are free. But when we fail to close a tree, we may wonder if this is due to the fact that it is indeed impossible to close the tree or if we simply chose a bad strategy that indefinitely delayed some choices that would have permitted us to close the tree. Such a strategy is unfair.

Figure 5.2. Procedure semantic tableaux (FOL)

Figure 5.2

Of course, this does not mean that using a fair strategy (i.e. a strategy that never delays a choice indefinitely) can transform an undecidable problem into a decidable one, but it permits us to eliminate some artificial non-terminating cases.

The following example is convincing.

EXAMPLE 5.8.– Assume that we want to show the soundness of the following reasoning (a denotes a constant):

equ

If we apply a fair strategy, we easily prove that this is a correct reasoning:

ieq

However, if some choices are delayed indefinitely:

ieq

EXAMPLE 5.9.– Consider the famous syllogism “Every man is mortal. Socrates is a man. Therefore, Socrates is mortal”. Its translation in FOL is:

ieq

where:

H(x): x is a man.

M(x): x is mortal.

a: Socrates.

To prove that the reasoning is correct, we consider the set

image

EXAMPLE 5.10.– Consider the reasoning:

image

We try to construct models for the set of wffs 1, 2, 3 below (2 is the negation of the conclusion).

image

Note that, in this example, we used some general principles in the method (indicated in the algorithm) that correspond to normal practices in mathematics:

– we replaced ∃x by c, a fresh constant (that did not occur in the considered wffs);

– once we have introduced a constant in place of ∃x, we are no longer allowed to use (2) (which is why we mark (2) as used (ieq));

– in (3), variable x can potentially be replaced infinitely many times, which is why it cannot be marked as used. We see that ieq can cause trees to be infinite;

– similar to the case of PL, in which each wff that we used was (implicitly) marked, we mark (1) with ieq.

EXAMPLE 5.11.– A problem arises: what happens if the reasoning that we are verifying is not correct, in other words, if the associated set of wffs is not contradictory? The answer is the same as in PL: there will be open branches. But the difference is that there may be infinite branches in FOL. We examine a case in which the method halts and others in which it does not.

equ

We thus consider the set of wffs 1,2 below

equ

We halt without being able to close the tree. We have a model of the set of wffs, i.e. a counter example of the initial reasoning. The meaning of the open branch is simple: it is a unary relation (i.e. a property) corresponding to P that is true for b (i.e. b belongs to the relation) and false for a (i.e. a does not belong to the relation). This interpretation makes the premises true and the conclusion false.

More formally, an interpretation image can be extracted from the open branch of the tableaux (see definition 5.6), which is a counter example of the proposed reasoning:

equ

with:

equ

in image

In other cases, it is not possible (for the method, a human would easily realize that it will not halt).

If we want to test the validity of the wff:

equ

we test the unsatisfiability of:

equ

“we can see” that the method is trying to construct an infinite model (think of D: N and P(x, y): x < y).

EXAMPLE 5.12.- We want to test whether the following reasoning is correct using the method of semantic tableaux.

equ

This is formalized in FOL using the following predicates:

I(x) : x is an engineer;

D(x) : x has a university diploma;

P(x) : x is poor.

equ

We thus try to construct models of the premises and of the negation of the conclusion.

equ

The leftmost branch cannot be closed (the method does not detect this property, see also theorem 5.11) and provides a counter example of the initial reasoning: someone who has a university diploma (D(a)), who is poor (P(a)), and who is not an engineer (¬I(a)). We could imagine a universe containing only a poor lawyer, or a universe in which none of those who are poor and have a university diploma are engineers.

Of course, there can be poor engineers, but the proposed reasoning does not prove this.

EXAMPLE 5.13.– A seldom explored characteristic of semantic tableaux is the possibility to detect in some cases the n-validity of a formula (which means that a formula is valid in every universe D such that card(D) < n, nimage) but can be falsified in any universe of a greater cardinality. We use the method of semantic tableaux to show that the wff

image

where:

image

is three-valid.

image states (see Leibniz's law, section 9.1.4) that there exist three distinct objects x, y, z.

The last three conjuncts express the fact that each of the tree objects is different from the other two, as a given object cannot have and not have a property.

image

We analyze what happens in universes of cardinality 1, 2, 3 (branches are identified with the standard notation on trees):

card(D) = 1

a = b = c = d contradiction in branch 1.

card(D) = 2

a = b = c contradiction in branches 1.1 and 1.2.

a = b = d contradiction in branch 1.

a = c = d contradiction in branch 1.

b = c = d contradiction in branch 1.

a = b and c = d contradiction in branch 1.

a = c and b = d contradiction in branch 1.

a = d and b = c contradiction in branch 1.

card(D) = 3

a = b contradiction in branches 1.1 and 1.2.

a = c contradiction in branches 1.1.1; 1.1.2; 1.2.1; and 1.2.2.

a = d contradiction in branch 1.

b = c contradiction in branches 1.1.1.1; 1.1.1.2; 1.1.2.1; 1.1.2.2; 1.2.1.1; 1.2.1.2; 1.2.2.1; and 1.2.2.2.

b = d contradiction in branch 1.

c = d contradiction in branch 1.

For universes D with card(D) ≥ 4, no branch can be closed (the open branches provide counter models of the initial formula).

REMARK 5.14.– In this example, we implicitly violated the requirements of rule δ (i.e. that every constant introduced by an existential quantifier must be a fresh constant that is not introduced by any other existential quantifier).

This violation allows us to enumerate the models of all cardinalities for which a non-valid formula can be satisfied.

It is not difficult to show that we have extended the method without losing its soundness and completeness properties.

We may wonder whether this example can be generalized to any arbitrary n. This is the topic of the following exercise.

EXERCISE 5.2.– Can we give a wff in FOL that specifies the n-validity for ieq (i.e. for an arbitrary and fixed value of n)? (See also example 9.31.)

EXERCISE 5.3.– Can you prove that following reasonings (respectively, wffs) (a) to (l) given below are correct using the method of semantic tableaux?

a) ieq

b) ieq

c)

ieq

d) Prove that: every irreflexive13 and transitive relation is asymmetrical.

equ

e) ieq

f)

ieq

g)

ieq

h)

ieq

i)

ieq

j) Add a premise to the reasoning of example 5.12 so as to make it correct.

Give the corresponding closed tableaux.

k) Use the method of semantic tableaux to determine if the following formula:

   k1) is not valid, and if this is the case, extract a counter example from the tableaux;

   k2) is valid, and in this case give a model obtained using the method of semantic tableaux.

ieq

1) a, b, c, d, e denote constants.

1) P(a, b)

2) P(b, c)

3) P(c, d)

4) P(d, e)

ieq

EXERCISE 5.4.– Use the method of semantic tableaux to tell whether the following reasoning is correct or not.

If it is incorrect, extract a counter example of minimal cardinality from the tableaux.

ieq

5.4. Unification in the method of semantic tableaux

In the method of semantic tableaux for FOL, there are two main problems, the first with rule γ, which corresponds to the instantiation of universally quantified variables, and the other with rule δ, which corresponds to the introduction of fresh and unique constants as instantiations of existentially quantified variables.

– The problem with rule γ, which may generate infinite branches, is to find adequate instances so as to close the branches (that can be closed) at the least possible depth.

A solution that is frequently adopted in implementations is to replace a universally quantified variable, say x, by a (free) variable X.

This renaming shall be written as xX.

Of course, the “disappearance” of the universal quantifiers must not hide the fact that the free variables that were introduced can be replaced by any number of terms. To keep this property, we introduce renamings of the free variables that we shall note: xX1, X1X2 X2X3,…

– The problem with rule δ is that, when there will be, say, n free variables X1, X2, …, Xn that have been introduced in the branch corresponding to formula F, where ieq appears in the scope of X1,…, Xn, as usual, ieq will be erased, and y will be replaced by f(X1, X2,…, Xn), where f is a new functional symbol called a Skolem function. This guarantees the introduction of a new name (constant) each time there is an instantiation of an existentially quantified variable, which is in the scope of universally quantified variables (syntactically different terms correspond to different names), i.e. the most general case.

(This is what we have done systematically, for example, in example 5.11)

– The unification algorithm is used to find the instantiation that allows us to close branches or to detect whether they (still) cannot be closed, therefore, suggesting renamings of the free variables (and implicitly of the existentially quantified variables that are in the scope of the free variables).

EXAMPLE 5.14.- (unification in semantic tableaux, 1). Prove the validity of the formula:

image

Note that in formulas 11 and 12, we have the same X.

EXAMPLE 5.15.– (unification in semantic tableaux, 2). Prove the validity (or non-validity) of the formula:

ieq

therefore, the formula is not valid.

EXERCISE 5.5.– Show that the following reasoning is correct using the method of semantic tableaux with free variables (i.e. using unification).

equ.gif

5.5. Toward a semi-decision procedure for FOL

It is impossible to design a decision procedure for FOL. Indeed, FOL formulas can be used to describe any Turing machine, and deciding the validity of an arbitrary wff is equivalent to solving the halting problem (which is undecidable).

But there is nothing stopping us from searching for a semi-decision procedure for this logic (only hope for the automation of such a procedure)14, i.e. a procedure that, if it stops, gives a correct answer, but for which we cannot say anything if it has not stopped at a given moment.

To test if a formula is satisfiable or valid, we (potentially) have to test infinitely many universes, which is impossible. We will see that it will suffice to restrict ourselves to a priviledged universe that will have “good properties”. The first step in this direction is to transform the formulas into a normal form.

5.5.1. Prenex normal form

When we consider a set of objects that can have many different forms, it is desirable to have a transformation into a normal form. It permits us, for example, to study the properties of these objects in a uniform manner and to state these properties more easily.

DEFINITION 5.8.– A wff of FOL F is in prenex normal form, (denoted by pr(F)) iff it is of the form:

ieq (n = 0 means that the formula contains no quantifier) where Qi: ∀ or

Q1x1Qnxn is called the prefix.

image: does not contain any quantifier and is called the matrix.

We implicitely assume that (see definition 5.1) if Qi ≠ Qj, then xi ≠ xj (meaning that a same variable is not quantified by different quantifiers).

THEOREM 5.3.– (existence of the prenex normal form). If F is a wff of FOL, then there exists an equivalent pr(F).

PROOF.– (outline). Apply the equivalent transformations below and reason by induction on the number of connectives.

The rules assume that ieq (rename if necessary)

ieq

1, 2, 3, 4 are sufficient (the other rules can be applied using the equivalent formulas of exercise 3.2).

 

EXAMPLE 5.16.– We can use (this is what we will do in exercise 5.7) the method of semantic tableaux to prove the validity or non-validity via a counter example of expressions denoting wffs that we will call “generic formulas” i.e. sets of formulas with a given structure, that can be characterized by naming their subformulas.

We prove below the validity of rule 5, which is used in the proof of theorem 5.3.

ieq

We will also use the information provided by the method of semantic tableaux to construct a counter example of an incorrect transformation rule that we might be tempted to use: as subformula G does not contain the quantified variable x, we can include G in the scope ofx.

ieq

We can extract a model from the negation of the formula (i.e. a counter example of the considered formula) in the open branch (there are no longer any universally quantified formulas: 2 was replaced by 8 and 9), by taking, for example:

equ.gif

image

(This replacement respects the initial hypotheses.)

and the structure image

with:

image

and:

image

The counter example constructed by the tree corresponds to:

image

This is indeed a counter example, the verification is immediate:

image

(∗) is therefore evaluated to F in the proposed interpretation.

 

Is the prenex normal form unique? The following example shows that this is not the case.

EXAMPLE 5.17.– (non-uniqueness of the prenex normal form). The order of application of the rules can lead to different prenex normal forms for the same formula. Consider the formula:

image

equ.gif

The prefix of the prenex normal form contains existential quantifiers. To establish fundamental theorems for the automation of FOL, we must introduce an operation permitting to eliminate them.

5.5.1.1. Skolemization

Skolemization (from the Norwegian logician T. Skolem) enables us to eliminate existential quantifiers while retaining the satisfiability of a formula.

The idea is that:

ieq admits a model, and f is a function symbol that does not appear in the considered formula

iff:

ieq admits a model.

but (image) and (imageimage) are not equivalent, i.e. are not evaluated to the same truth value for the same interpretations.

More generally:

the formula:

equ.gif

yields by Skolemization:

equ.gif

and if m = 0:

equ.gif

We will show, using the method of semantic tableaux, that:

equ

meaning that there exist models of ∀xyP(x, y) that are counter models of ∀xP(x, f(x)).

We will therefore try to construct models of:

equ

and if we succeed, we will have proved (imageimageimage).

equ

Using this tableaux, it is simple to construct the desired counter example (by letting f(a) ≠ b):

equ

with:

equ

Note that the tableaux guarantees that we can always (if ieq transform a model of ∀xyP(x, y) into a model of ∀xP(x, f(x)) (by letting f(a) = b).

This non-equivalence (sometimes called weak equivalence) is not really a problem when we try to prove that a wff does not have any model (i.e. that its negation is valid).

If we wanted equivalence to be preserved, we would have to replace:

equ

by:

fxP(x, f(x)), but this formula is not a wff of FOL (see the syntax of FOL in definition 5.1 and exercise 9.5).

REMARK 5.15.– Another way to prove that Skolemization does not preserve equivalence (but only satisfiability) is to consider the following counter example.

The formula:

equ

is valid (as can easily be checked using the method of semantic tableaux or by noticing that this formula is equivalent to ∀xP(x) ⇒ P(a)).

If we transform (image), we first obtain:

equ

and using Skolemization:

equ

which is a satisfiable but not valid formula (as P(a) can be evaluated to F and P(b) to T).

5.5.2. Skolem normal form

Starting with a FOL formula F, after transformation into prenex normal form and Skolemization, we obtain the Skolem normal form of F (denoted by sk(F)):

sk(F): ∀x1 … ∀xnF′, where F' does not contain any quantifier and Var(F') = {x1xn}

Therefore, by theorem 5.3 and the Skolemization property:

(image) F wff of FOL is satisfiable iff sk(F) is satisfiable

DEFINITION 5.9.– (universe, base, Herbrand interpretation). Given a finite set S of formulas in Skolem normal form constructed on the set of predicate symbols π and function symbols image, the Herbrand universe on image (or Herbrand universe of S) is defined as follows:

equ

if F does not contain any constant, then H0 = {a};

equ

ieq.

(With the notation of definition 4.1, we should note Σ(F) instead of H(S).)

The terms in H(S) are obviously closed (see definition 4.1) and are called Herbrand terms.

The Herbrand base of S is the set of positive literals (i.e. of atomic formulas):

ieq or ieq ieq

where ieq means all variables in L are replaced by Herbrand terms. ieq is a Herbrand instance or simply constant instance or closed instance of ieq. We shall also talk of (see definition 5.10) closed clauses.

AFc: closed atomic formulas in S.

Notation: here, as is customary, ieq denotes an n-tuple of variables and ieq denotes an n-tuple of Herbrand terms.

A Herbrand interpretation of a set of universally quantified formulas S constructed on (π, image) is an interpretation imageH(S) such that:

D = H(S)

if ieq

if ieq

with:

equ

(and of course tiH(S); 1 ≤ in)

if ieq

with ieq

A Herbrand interpretation can be represented by ieq.

The obvious intuitive meaning is that the literals ieq are evaluated to T on the n-tuples ieq or that ieq.

The set of Herbrand interpretations of S is thus the set of subsets of B(S).

REMARK 5.16.– The Herbrand universe corresponds to what is called the term algebra in universal algebras., i.e. (see definition 5.4):

equ.gif

EXAMPLE 5.18.S = {C1, C2, C3}

equ.gif

a Herbrand interpretation:

equ.gif

meaning that P(a) is evaluated to T and that P is evaluated to F on all other elements of H(S). Q(f(a)) is evaluated to T and Q is evaluated to F on all other elements of H(S).

Another Herbrand interpretation:

equ.gif

meaning that P is evaluated to T on all elements of H(S), and Q to F on all elements of H(S).

EXERCISE 5.6.– Let image denote the following set of wffs:

equ.gif

Can you give three Herbrand models of image? Which ones?

REMARK 5.17.– By construction, the Herbrand universe (and the Herbrand base) of a set of formulas S is either finite (if no function symbol occurs in S) or denumerably infinite.

As a consequence, the number of Herbrand interpretations for a set of formulas S is either finite or uncountably infinite (see exercise 3.1).

For example, we can give an uncountably infinite model of the formula ieq, for example, ieq, and we can also give a denumerably infinite one, for example, ieq. This example is a particular instance of the following theorem.

THEOREM 5.4.– (Löwenheim–Skolem). If a FOL wff F has a model, then it also has a denumerable model.

PROOF.–

– It suffices to consider sk(F), see (image) in section 5.5.2.

– We assume that D is the domain of discourse of the model of sk(F).

– If a universally quantified wff (such as sk(F)) is satisfied on a domain D, then it is also satisfied on a domain D′ ⊆ D (see definition 5.6 and remark 3.39).

– We consider H(sk(F)) from which we will construct a denumerable set D′.

– We begin by the (necessarily finite) set of constants in F or by the additional constant, which will denote, in the model, elements of D. These will also be elements of D'.

– The terms f(n)H(sk(F))(t1, …, tn) denote elements of D in the model (see definition 5.6) that are added to D' (D' is closed by this operation, by definition of a Herbrand universe).

– By construction D' is either finite or denumerably infinite (see remark 5.17). This proves the theorem.

EXAMPLE 5.19.– Consider the wff:

equ

with the intended interpretation: for all reals there exists a greater real;

we obtain by Skolemization:

equ

A model can be constructed on the structure:

equ

where ieq

equ

if, for example, we fix ieq, we obtain

equ

A Herbrand model:

equ

We have the following immediate corollary:

COROLLARY 5.1.– (Löwenheim-Skolem for finite sets of formulas). If S is a finite set of FOL wffs that admits a model, then S admits a denumerable model.

PROOF.– Let S = {f1, f2,…, fn}.

By definition (see definition 3.8) S has a model iff there exists a model that satisfies all the formulas in S, i.e. iff:

equ

The corollary is proved by applying theorem 5.4 to F.

REMARK 5.18.– The Löwenheim-Skolem theorem also applies to denumerably infinite wffs of FOL: if S is a denumerably infinite set of wffs of FOL that has a model, then S has a denumerable model.

REMARK 5.19.– (an important consequence of the Löwenheim-Skolem theorem). An immediate consequence of the Löwenheim-Skolem theorem is that the intended interpretation of a wff of FOL is not unique: there can also be unintended interpretations.

As a consequence, FOL formulas cannot characterize uncountably infinite sets15, because we know that along with such a set, they will also admit a denumerable model (i.e. they will also characterize a denumerable set).

The Löwenheim-Skolem theorem permits us to imagine a mechanical validity test (as it will be performed on denumerable domains).

There remain two questions that, if answered positively, make the existence of such a test impossible:

– would we have to test all interpretations on a given denumerable domain?

– would we have to test all denumerable domains?

The answer to both questions is (fortunately) negative.

REMARK 5.20.– (on interpretation domains). Before we formalize these answers, note that the only requirement on the domain of an interpretation is that it should not be empty. It can, in particular, consist of terms without variables (closed terms) constructed on the same signature as (the Skolem normal form) of the initial formula.

The negative answer to the first question is a result of the following theorem.

THEOREM 5.5.We can test the validity of a wff of FOL on a denumerable domain without taking interpretations into account.

PROOF.–

– Let F denote the wff whose validity we want to test.

– ¬F is satisfiable iff ieq is sat (see section 5.5.2).

F is valid iff ¬F is unsatisfiable.

– ¬F is unsatisfiable iff skF) is unsatisfiable.

– To test the validity of F, we therefore test whether skF) is unsatisfiable.

– Let D denote the domain on which we want to test the unsatisfiability of skF); D = {a1, a2,…, an, …}.

– We assume that ieq (Var is the set of variables and all variables are universally quantified by definition of the Skolem normal form).

– We want to enumerate the k-tuples of elements of D, that will be denoted by ieq.

% A bijection ieq can be defined by:

equ

– Testing the universally quantified formula skF) reduces to testing skF) on all the elements of Dk.

– We therefore consider ieq k-tuples of variables of skF).

If ieq is unsatisfiable then ieq such that ieq is unsatisfiable (propositional test; contrapositive of the compactness theorem for PL, theorem 3.3).

– This test is independent of the interpretation of the function symbols (and, in particular, of the constants) and of the predicates.

The negative answer to the second question is given by the following theorem.

THEOREM 5.6.A wff for FOL F is satisfiable iff it is satisfiable on the domain H (sk(F)).

PROOF.– If:

– We consider sk(F).

F is satisfiable iff sk(F) is satisfiable (see section 5.5.2).

– By hypothesis, sk(F) is satisfiable on H(sk(F))% (see remark 5.20).

– Therefore, F is satisfiable.

Only

– If F is satisfiable, then F is satisfiable on denumerable domain D (Löwenheim-Skolem theorem, theorem 5.4).

– We repeat the reasoning of theorem 5.4, but instead of taking elements in D, we take the Herbrand terms that denote them to construct another denumerable set D'.

D' = H(sk(F)).

The following theorem, which simply merges theorems 5.5 and 5.6, is essential for the automation of FOL.

THEOREM 5.7.– (Herbrand). A wff of FOL F is valid iff there exists a finite set of instances of sk(¬F) that is unsatisfiable (contradictory).

PROOF.–

F is valid iff ¬F is unsatisfiable.

– ¬F is satisfiable iff ¬F is satisfiable (see section 5.5.2).

– sk(¬F) is unsatisfiable iff (sk(¬F)) is unsatisfiable % HI: Herbrand Instances.

 

(semantic definition of universally quantified formulas, see definition 5.6)

– If HI(sk(¬F)) is unsatisfiable then there exists a finite subset of HI(sk(¬F)) that is unsatisfiable, (up to a syntactic modification, HI are propositional, and we may apply the (contrapositive of) the compactness theorem for PL (theorem 3.3)).

It is clear that Herbrand’s theorem enables us to design a semi-decision procedure for FOL:

Figure 5.3. Semi-decision procedure for FOL

Figure 5.3

REMARK 5.21.– (completeness of FOL). Gödel’s completeness theorem16 for FOL can be stated as follows: there exists a formal system in which every valid FOL formula has a proof.

The following is a formal system for FOL.

ieq with:

ieq: see definition 5.1

ieq: the inference rule schema M P from image1 together with the inference rule schemas G and P below:

ieq

image

image1: the axiom schemas (A1), (A2), and (A3) of image1 together with (A4) and (A5) below:

ieq

From a conceptual point of view, a formal system can be characterized as a “machine that produces (and tests) theorems in a given logic”, we can therefore view SEMI_DEC_PROC_FOL as a formal system for FOL and theorem 5.7 as a completeness theorem for FOL.

This theorem enables us to replace a test of validity on all interpretations (semantical notion) by a test of the existence of a proof (syntactical notion of a proof).

REMARK 5.22.– (very, very long proofs). To illustrate the idea, consider imageFOL from remark 5.21, but the property below holds for all systems ieq for which ieq ? is undecidable (immediate by analyzing the proof).

Property:

The length of a theorem T, denoted by length(T), is the number of symbols (from the vocabulary of the corresponding formal system) in its statement. Similarly, the length of a proof is the number of symbols in the proof (other definitions can be given such as number of steps, etc.).

For any recursive function (i.e. computable by an algorithm) f, there exist a wff T of FOL such that ieq, with ieq such that the shortest proof of T has at least length f(n).

PROOF.–

– Assume that this property does not hold.

– There therefore exists a recursive function F for which every theorem T of length n has a proof of length at most F(n).

– It thus suffices to enumerate the finite set of all sequences of length, at most F(n) constructed on a finite vocabulary to identify a proof of T.

– This would be a decision procedure enabling us to decide whether a wff is a theorem of imageL1O. Such a procedure cannot exist and we obtain a contradiction.

– Note that there exist theorems in imageL1O of length, say, N, such that their shortest proofs are of length 10100×N, for example.

It is natural to wonder whether there is a compactness theorem for FOL.

The answer is the topic of the next theorem.

THEOREM 5.8.– (compactness of FOL).

S : set of wffs of FOL.

If every finite subset of S is satisfiable, then S is satisfiable.

PROOF.–

– If S is finite, the proof is trivial, as S is satisfiable by hypothesis.

ieq (see remark 5.2).

– If a set of formulas is satisfiable, then so are all its formulas (Warning! The converse is not true, as all the formulas in a set have to be true in the same interpretation for a set of formulas to be satisfiable).

– Instead of S, we can consider ieq (see section 5.5.2).

– It is sufficient to consider H(sk(Fi)) as a domain to test satisfiability (see theorem 5.6).

– We enumerate the (increasing) finite sets of closed instances (i.e. propositional) of:

S1 = {sk(F1)}, S2 = {sk(F1), sk(F2)}, …, Sn {sk(F1), sk(F2),…,sk(Fn)},…

– As each formula involves a finite number of symbols, the sets of propositional formulas ieq are finite; thus, by hypothesis (and theorem 5.6), ieq is satisfiable.

– By applying the compactness theorem for PL, we conclude that ieq is satisfiable.

– By applying theorem 5.6, we conclude that S is satisfiable.

5.6. Semantic trees in FOL

A “natural” way of implementing procedure SEMI_DEC_PROC_FOL is to use semantic trees.

REMARK 5.23.– We do not have to restrict ourselves to formulas in clausal form, but the method can be applied to formulas in Skolem normal form, i.e. that are universally quantified (see definition 5.10 and remark 3.31).

The method of semantic trees for FOL is the same as that for PL, by considering literals on the Herbrand base B(S).

Indeed, by considering, for example, the set of formulas from example 5.18 and the universe H(S):

ieq

To produce a counter model of S, it is sufficient to give a Herbrand interpretation that is a counter model of a closed instance of a formula (i.e. of a conjunct on the right-hand side of “equiv.”).

The following example uses the method of semantic trees to show that the set of formulas S of example 5.18 is unsatisfiable.

EXAMPLE 5.20.–

image

where Ci (1 ≤ i ≤ 3) under × means: this interpretation falsifies a closed instance of formula Ci.

The leftmost branch in the tree corresponds to the first Herbrand interpretation of S given in example 5.18.

Of course, the tree that is constructed depends on the enumeration order of B(S).

Just as for resolution in PL, the resolution rule in FOL applies to sets of clauses. It is therefore necessary to define clauses in FOL.

DEFINITION 5.10.– (FOL clause, clausal form).

A clause is a wff of the form:

equ

where:

equ

(i.e. all the variables in P are universally quantified)

equ

Clauses are usually denoted:

equ

(variables are implicitly quantified universally)

Li: literal, i.e. of the form:

image

A formula is in clausal form iff it is of theform ieq, where the Ci’s are clauses.

More frequently, as it was the case in PL (see remark 3.33), we will mention sets of clauses (or the set of clauses corresponding to a formula) S = {C1,…, Cn}, and we will say that clauses are sets of literals.

If image and image are different clauses, then we always have ieq (possibly after a renaming of the variables).

The clausal form of a wff F can be obtained from sk(F) and the rules on logical connectives.

5.6.1. Skolemization and clausal form

Skolemization can make things complicated. Some preprocessing can sometimes be useful.

1) ieq

yields by Skolemization:

1') ieq

(1') generates an infinite Herbrand universe

but (1) is equivalent to:

equ

(see exercise 5.3 h)) and rename ieq)

and after Skolemization we obtain the clause:

equ

which generates a finite Herbrand universe;

and sometimes preprocessing makes matters worse.

2) ieq

yields by Skolemization:

equ

This clause generates a Herbrand universe containing one constant;

but (2) is equivalent to:

equ

which, by Skolemization, yields:

2') P(a) ∨ Q(b)

(2') generates a Herbrand universe containing two constants.

Sometimes it can “hide” information:

the formula:

equ

is obviously a tautology. Skolemizing this formula yields:

equ

and we obtain ieq,

which is equivalent to:

3) ieq

clause (3) will needlessly increase the size of the search space.

It can also increase the size of the problem specification. For the following formula:

equ

the standard clausal form transformation yields 1,600 clauses!

REMARK 5.24.– The notion of Skolemization is related to the one used in the proof-as-programs approach, in which an algorithm is extracted from a constructive proof of a program specification.

The intuitionistic version of Church’s thesis17 goes as follows: if Ar is a first-order predicate of arithmetic, ieq and ieq, then there exists an algorithm f such that ieq.

Herbrand’s theorem and the procedure SEMI_DEC_PROC_FOL enable us to obtain the following theorems as immediate corollaries.

THEOREM 5.9.– A set of clauses S is unsatisfiable iff for any semantic tree associated to S there exists a semantic tree that is closed and finite.

THEOREM 5.10.– (Herbrand’s theorem (for clauses)). A set of clauses S is unsatisfiable iff there exists a finite set of Herbrand instances of S that is unsatisfiable.

5.7. The resolution method in FOL

One may wonder whether the resolution rule also applies in FOL. The answer is yes.

In a famous paper from 1965, J.A. Robinson combined the resolution rule for PL with the unification algorithm, which led to a calculus with a unique rule permitting us to automate FOL.

This rule is defined as follows.

DEFINITION 5.11.– (resolution rule for FOL).

equ

If σ is the mgu of ieq ieq.

This means that the resolvent clause is obtained by unifying all literals ieq, and ieq, then applying the rule as in the propositional case.

 

In practical implementations, the rule above is replaced by binary resolution (i.e. p = q = 1, we select two complementary literals, one in each clause) and a factorization rule that aims at unifying two literals with the same predicate symbols and the same sign that occur in a same clause.

DEFINITION 5.12.– (binary resolution rule for FOL). Given two clauses:

equ

where:

image, image: disjunctions of literals.

If the system of equations:

equ

has mgu σ as a solution.

The binary resolution rule between C1 and C2 is defined by:

equ

Applying a substitution a to an n-tuple of terms is defined as follows:

equ

Applying a substitution a to a clause is defined as follows:

equ

We will note ieq or simply image (when there is no ambiguity). C is called the resolvent. C1 and C2 the parent clauses

DEFINITION 5.13.– (factorization). The restriction to two complementary literals causes the loss of completeness. To recover completeness, we need to add the so-called factorization rule which, starting with clause:

equ

with image: disjunction of literals (that may contain other literals of the form ieq and ieq and ieq unifiable, generates:

equ

where σ is the mgu of ie191_04 and ie191_05

D is called factor of C.

A clause can have several factors.

EXAMPLE 5.21.– (the need for factorization to retain completeness). The set of clauses {P(x) ∨ P(y), ¬P(z) ∨ ¬P(u)} is unsatisfiable, but binary resolution generates infinitely many clauses of the form

equ191_06

without generating.

However, the factorization rule generates P(x) and ¬P(z), and the binary resolution rule generates.

DEFINITION 5.14.–

Given a clause C, a copy or variant of C is a clause in which all variables of C have been renamed by fresh variables.

A clause C is self-resolving iff the resolution rule can be applied on C and a copy of C. One such example is clause 2 of example 5.22.

EXERCISE 5.7.– (soundness of binary resolution). Use the method of semantic tableaux to prove that the binary resolution rule for FOL is correct (i.e. that every model of the parent clauses is a model of the resolvent).

REMARK 5.25.– (unsatisfiability and satisfiability by resolution). Each branch in a semantic tree (see section 5.6) denotes a partial interpretation of the set of clauses S; if S is unsatisfiable, then all the branches will falsify an instance of at least one clause in S (closed tree). By “unfolding” the closed tree (see the correction of exercise 3.34), we can obtain a refutation by resolution of a set of Herbrand instances of S. The proof is completed by using the so-called “lifting lemma” that enables us to relate closed instantiated clauses (i.e. propositional clauses) and those that are not instantiated. in other words, the following diagram commutes:

equ192_01

where σ, θ, ρ, and γ denote substitutions (σ and γ are closed substitutions) and image the operation that yields the resolvent of two clauses.

Soundness and (a consequence of) refutational completeness are often presented using operator image (see also definition 3.16):

Let S denote a (finite) set of FOL clauses.

equ192_02

image*(S) denotes the search space, of which all strategies try to explore the smallest subset.

Thus,

– if ie192_02, then S unsatisfiable.

– if ie193_01 and ie193_02, then S satisfiable.

– else (FOL undecidable)? (This alternative is impossible in PL).

EXAMPLE 5.22.– Consider the clauses 1, 2, and 3 below. We indicate an application of the resolution rule by specifying, as for PL, the selected clauses and literals, together with the unifier.

1) P(a)

2) ie193_03

3) ie193_04

4) ie193_05

EXAMPLE 5.23.– (what should not be done). We may wonder why it is necessary to apply the method strictly if “we can see” the replacements that can be done to apply the resolution rule for PL, in other words, whether we can get rid of unification:

1) P(a)

2) ie193_06

3) ie193_07

4) ie193_08

5) ie193_09

This way of proceeding is correct from a logical point of view (variables in clauses are universally quantified and can be replaced by any constant), but it is incorrect if you are asked to apply the resolution rule in FOL.

Furthermore, it neglects the most original and powerful characteristic of the resolution rule: the presence of the unification algorithm.

Perhaps, you can convince yourselves by trying to “see” what replacements should be performed to apply resolution between clauses 2 and 3 below:

1) P(a)

2) ie193_10

3) ie193_11

EXAMPLE 5.24.– (grandparents).

Every human has a parent:

i) ie193_12

The parent of a parent is a grandparent:

ii) ieq

Every human has a grandparent:

iii) ieq

We want to use the resolution rule to show that (iii) is a logical consequence of (i) and (ii). We therefore negate and Skolemize ie194_03. It is also necessary to Skolemize (i).

We consider the set of clauses 1, 2, 3 below.

1) P(f(x),x)

2) ie194_04

3) ie194_05

and we provide a refutation for this set:

4) ie194_07

% formally speaking, the unifier is ie194_08, but as the couple xv is not useful in what follows, it is not included.

5) ie194_09

6) ie194_10

EXAMPLE 5.25.– (natural numbers). The following set of clauses translates the statement 0 is a natural number and if x is a natural number, then so is the successor of x:

equ194_01

We want to use the resolution rule to show that 3 is a natural number. We therefore add the following clause to the two previous ones:

equ194_02

and we try to derive.

a) Backward chaining:

equ194_03.gif

b) Forward chaining:

equ195_01.gif

EXAMPLE 5.26.– (first negate and then Skolemize). Consider the following reasoning, formalized in FOL:

equ195_02

Can you prove that this reasoning is correct (or incorrect)?

To prove that the reasoning is correct (or incorrect)

using the resolution method

Mr (or Mrs) A proposes:

Skolemize the conclusion, then negate the result, which leads, say, to formula (3'), and then try to prove the unsatisfiability of the set of clauses obtained from (1), (2), and (3')

and

Mr (or Mrs) B proposes:

Negate the conclusion, then Skolemize the result, which leads, say, to formula (3''), and then try to prove the unsatisfiability of the set of clauses obtained from (1), (2), and (3'').

Who is right?

a) Mr (or Mrs) A

b) Mr (or Mrs) B

c) Both of them

d) None of them

i) We use the method proposed by Mr (or Mrs) A

equ196_01

The set of clauses to refute is thus 1. to 3.:

1) ie196_01

2) ie196_02

3) ie196_03

4) ie196_04

5) ie196_05

The resolution rule can no longer be applied; hence {1., 2., 3.} is sat and as a consequence, the reasoning is incorrect (according to Mr. (or Mrs) A)

ii) We use the method proposed by Mr (or Mrs) B

equ196_02

The set of clauses to refute is thus 1. to 3.:

1) ie196_06

2) ie196_07

3) ie196_08

4) ie196_09

5) ie196_10

We have proved that the set of clauses {1., 2., 3.} is unsat, and as a consequence, the reasoning is correct (according to Mr (or Mrs) B)

Mr (or Mrs) B is right.

Why is that?

Proof in natural language

Q denotes a total relation (1.), i.e. for any object x, there exists an object y that is related to x in Q. Two objects that are in the relation denoted by Q are also in the relation denoted by P (2.). Hence, for any object x, there exists an object y that is related to x in P.

Formal proof (semantic tableaux)

We consider the set of formulas {∀xyQ(x, y), ∀xy.Q(x, y) ⇒ P(x, y), ∃xy¬P(x, y)}

eqi197_01

Explanation

If formula Q is a logical consequence of formula P, then the relationship between their models is:

figu197_01

But as Skolemization can lead to the “loss of models”, after it is performed, we may get the following relationship between the models of the premises (P) and the conclusion (Q).

figu197_02

The shadowed zone in P corresponds to the counter examples.

EXERCISE 5.8.– Use the resolution method to prove that the following reasoning is correct.

equ197_02

EXAMPLE 5.27.– Consider the set of clauses 1 to 7 below.

We show that this set is unsatisfiable by using a unit strategy (at least one of the parents is a unit clause). The underlying idea is that the obtained resolvent contains strictly less literals than the non-unit parent clause, and the rule thus generates clauses that are potential candidates for the generation of.

equ198_01

EXAMPLE 5.28.– (a theorem in group theory). We use the resolution rule to show that every element of a group has a right inverse.

Clauses 1 to 6 below are the clausal form of the set of axioms that define a group and of the negation of the conclusion.

We apply a backward chaining strategy, meaning that we begin by applying the resolution rule with the negation of the conclusion as one of the parent clauses, and we proceed with a linear strategy, meaning that one of the parent clauses is always the last clause obtained.

This is very close to what a human would do: conclusions (lemmas) do not need to be memorized for future usage.

Similar to what a program would do, we have systematically renamed variables to avoid any confusion.

A linear strategy is often represented graphically as follows:

figu199_01

equ199_01

EXAMPLE 5.29.– (the monkey and the banana). A monkey wants to eat a banana that is hanging from the ceiling of a room. The monkey is too small to reach the banana. However, the monkey can walk in the room, carry a chair that is in the room, climb on the chair and take the banana to eat it.

We want to describe this situation with a set of clauses. Functional terms can be used to denote actions.

The question will be: does there exist a state that is reachable from a given initial state, where the monkey can catch the banana?

In order to solve this problem using resolution, we choose the following particularly simple formalization (set of Horn clauses, see section 3.9).

P(x, y, z, s): in state s, the monkey is at position x, the banana at position y, and the chair at position z.

R(s): in state s, the monkey can reach the banana.

f(x, y, s): the state that is reached from state s, if the monkey walks from x to y.

h(s): the state reached if the monkey is in state s and climbs on the chair.

P(a, b, c, d): the initial state.

The corresponding set of clauses is:

equ200_01

The question is ie200_01, which will be negated to try to derive image, thus yielding the clauseie200_02.

Sometimes, the question is ie200_03 Answer(u) to explicitly retrieve the answer (see solution to exercise 5.9).

EXERCISE 5.9.– Find the solution to the problem of the monkey and the banana by applying the resolution rule and a linear strategy.

EXERCISE 5.10.–

a) prove by resolution that the set of clauses below is unsatisfiable:

equ200_02

b) consider the set of clauses below:

equ200_03

Is it possible to prove by resolution:

i) that it is unsatisfiable?

ii) that it is satisfiable?

iii) we cannot say anything?

5.7.1. Variables must be renamed

The clause ie201_01 is equivalent on the Herbrand universe (see definition 5.9) on ie201_02 to

{P(a) ∨ ieq Q(b), P(f (a)) ∨ ieqQ(f (f (b))),….}

But if we want to discover the instances of interest by unification, it is better to write:

equ201_02

with

equ201_03

(the sigmai correspond to substitutions that would be computed by the resolution rule)

EXAMPLE 5.30.- We prove by resolution that the set of clauses 1,2,3 below is unsatisfiable:

equ201_04

If variables are not renamed in 1, the contradiction cannot be proved (we would have assimilated ie154_01 with re, i.e. usable only once).

EXERCISE 5.11.- Is the wff ie201_08 a logical consequence of ie201_09 With symbols:

equ201_05

As usual, x and y denote variables and P a predicate symbol.

Answer using the resolution method.

EXERCISE 5.12.– (S1 and resolution). We have already appreciated the general difficulty of finding a proof in a formal system (for example, S1). Hence, the idea of trying to do this work automatically by using, for example, the resolution rule.

You are asked:

i) To encode as clauses A1, A2, A3, and MP (see section 3.4) and to prove, using the resolution rule, that:

ie202_01

ii) To rephrase (as you would, for example, to explain it to someone who does not know the resolution rule) this proof.

Hint: encode ie202_02 by i(x,y) and use predicate symbol P with the meaning P(x): x is provable in image1.

5.8. A decidable class: the monadic class

FOL is undecidable (but semi-decidable). Finding classes or fragments (i.e. sets of cwffs that are proper subsets of s_l1 and that are decidable is one of the most important problems of logic, which is known as the “classical decision problem (for FOL)”. It can be presented in different ways.

Given F rev s_l1, the problem of:

– satisfiability (coherence, consistency): decide if F is satisfiable;

– validity: decide if F is valid;

– provability: given a formal system image that is correct and complete, decide whether ls F.

The interest of being able to characterize such classes (or fragments) is clear: trying to have a “good” expressive power, while retaining “very good” decidability properties.

In this section, we shall prove the decidability of some fragments of FOL. We begin by some definitions.

DEFINITION 5.15.– (finitely controllable class, finite model property). A class image is finitely controllable or has the finite model property iff for all Fimage, if F is satisfiable, then F admits a finite model.

REMARK 5.26.– Every finitely controllable class is decidable. The converse is not true: there are decidable classes that do not have the finite model property.

Among the finitely controllable class, we shall study monadic logic.

DEFINITION 5.16.– (monadic class of FOL). The set of cwffs of image1 containing exclusively unary predicates (and possibly =), but not containing any functional symbols (in particular, constants) is called the monadic class of FOL (or monadic FOL), denoted by MFOL=.

If the cwffs do not contain the equality symbol =, then we have the pure monadic class, denoted by MFOL.

MFOL was used to formalize Aristotle’s syllogistic. See also digression 8.1.

The proof of the decidability of MFOL= is based on the following remarks:

1) To test the satisfiability of a wff of FOL (see definition 5.6), what matters is the cardinality of the domain of discourse D of the potential model (the definition of satisfiability does not take the names of the elements of D into account);

2) On a finite domain, say ie203_01 is equivalent to ie203_02 and ie203_03 is equivalent to ie203_04.

3) Key point: (theorem 5.11): proving that MFOL= is finitely controllable by providing an upper bound on the cardinality of the domains on which it suffices to test the satisfiability of the formulas in the class.

4) On a finite domain, we can consider all possible evaluations of unary predicates (and equality between variables) and use property 2 above. There are therefore only a finite number of interpretations to test.

The following theorem proves to be the key property of the decision procedure for MFOL=.

THEOREM 5.11.– (MFOL= has the finite model property). A cwff F of MFOL= containing k predicate symbols and v variables is satisfiable (on a structure ie203_05 iff F is satisfiable on a structure

equ203_01

PROOF.– (detailed outline).

if:

Trivial: if a wff is satisfiable on a domain of a given cardinality, then it is satisfiable.

only if:

Define relation R on D:

for alpha1, alpha2 rev D

alpha1 R alpha2 iff:

ie204_02 and ie204_03 and … and ie204_04

where the ie204_13 denote the k predicates in F and, as usual, ie204_05(j = 1, 2) T or F depending on whether Pi is evaluated to T or F on aj.

If we were to rigorously stick to definition 5.6, we would have to say that a1, a2 are in relation R if and only if they belong (or do not belong) to the relation assigned by the interpretation (model) to ie204_14, i.e.

ie204_06

% The idea is that the elements of D on which the predicates are evaluated to the same truth value are regrouped.

R is an equivalence relation (see definition 3.26).

The proof is trivial and is a result of the properties of equality (see also section 9.1.4):

– reflexive a1 R a1, as ie204_08;

– symmetric: if a1 R a2 then a2 R a1, as if ie204_09, then ie204_16.

– transitive: if a1 R a2 and a2 R a3, then a1 R a3, as if ie204_09 and ie204_08, then ie204_11.

As there are two possibilities for each Pi (for any alphaj), there are 2k equivalence classes.

If we now consider the equalities, that can only relate the v variables (see definition 5.16), it is sufficient, for each equivalence class, to consider at most alpha1, alpha2,…,alphav elements (alphaiD; ie204_16a. If the equivalence class contains p(p<v) elements, we consider a1, a2,…, ap.

We thus consider:

ie204_12: with

equ204_03

i.e. cardie205_09.

We define the relations ins_r':

ie205_01 iff ie205_02, where [a] is (a representative of) the equivalence class of a (aD).

% Recall that equivalence classes of D form a partition of D.

By structural induction (see section 5.2.3) and using properties 1 to 4 of section

5.8, we prove:

equ205_01.gif.

REMARK 5.27.– (syllogistic and decidability). Aristotelian syllogisms can be formalized in MFOL (see remark 2.7). As this is a decidable fragment of FOL and as the latter is undecidable, syllogistic is not sufficient to reason in FOL.

EXAMPLE 5.31.– (see also example 5.11). ie205_10

Here, k = 1; v = 1; hence, it suffices to test ie205_11

Indeed, we consider enterF, and on Dmax, we can obtain the models of enterF (i.e. counter examples of F): ie205_12. Hence, F is not valid.

EXAMPLE 5.32.– (some cwffs in the monadic class). We have treated some of those by the method of semantic tableaux in example 5.13, exercise 5.3 (a)-(b)-(h)-(k2), and exercise 5.4.

Note that, in general, we can detect (non)-validity on universes of a lesser cardinality than the upper bound of theorem 5.11.

5.8.1. Some decidable classes

There exist techniques other than the one we used to solve the classical decision problem for MFOL=. These techniques are beyond the scope of this work.

The decidable fragments of FOL are characterized by the prefixes of the prenex normal form that is equivalent to the cwff that is provided as an input (see theorem 5.3).

Bernays-Schönfinkel: ie205_05 (also denoted by ie205_06; M in MFOL);

Ackermann: ie205_07 (also denoted by ie205_08);

Herbrand: arbitrary prefix and matrix ie206_01 with Li (1 ≤ in): literals;

– Gödel-Kalmar-Schütte: ie206_02 (also denoted by ie206_03;

ie206_04 with ie206_05 and Li (1 ≤ in): disjunction of literals with at most one positive literal.

5.9. Limits: Gödel’s (first) incompleteness theorem

A particularly simple proof of this capital theorem (given by G. Boolos) uses the following notions: paradox, arithmetic, truth, proof, algorithm and encoding.

Paradox

Here it will be the Berry’s paradox, see example 2.1.

Arithmetic

See example 3.8.

Truth

See section 5.2.1.

Proof

See section 3.3.

Algorithm

Informally, an algorithm is any well-defined computation procedure that admits a (set of) value(s) as an input and produces a (set of) value(s) as an output. Examples are a program (in a programming language), a Turing machine, Markov algorithms, formal systems for arithmetic, etc.

Encoding (in arithmetic)

Encoding a text consists in replacing a word or sentence by another word, a number or a symbol. In cryptography, a code uses the substitution at the word level, whereas a cipher uses the substitution at the level of letters. The goal is to hide information.

We shall use a translation that associates to every wff of a given language an integer (i.e. a word in arithmetic). The goal is not to hide information but to change its representation.

Arithmetic enables us to uniquely encode into a natural number any sequence of symbols (i.e. a string on a vocabulary), for example, a wff in s_l1, instructions of a Turing machine (or of a program), a computation of a Turing machine (as it can be described as a sequence of instantaneous descriptions of the Turing machine), proofs in a formal system, etc.

The first to propose an encoding was K. Gödel (in 1931), the natural number encoding an expression M has since been known as the Gödel number of M, denoted by gn(M).

DEFINITION 5.17.– Let M denote an expression (a word) on a vocabulary V.

We assign to each symbol in V an odd number (> 1):

equ207_01

Given the expression ie207_01

equ207_02

the Gödel number of M is the natural number:

equ207_03

where Prime(k) is the kth prime number.

If M = є (i.e. the empty string), then ng(є) = 1.

For example, for a string ie207_02

Why this encoding? The justification is immediate if we recall the fundamental theorem of arithmetic (see below).

THEOREM 5.12.– (fundamental theorem of arithmetic). Every x rev image (x > 1) can be represented as

equ207_04

with ie207_03: prime and ie207_04.

This representation is unique (up to the commutativity of ×).

An immediate corollary is:

COROLLARY 5.2.– (uniqueness of the encoding of words). If ng(M) = ng(N), then M = N.

DEFINITION 5.18.– (Gödel number of sequences of words). Let ieq: M1M2Mn denote a finite sequence of expressions (i.e. words on a vocabulary), the Gödel number of ieq is defined as:

equ208_01

An immediate corollary is the following:

COROLLARY 5.3.– (uniqueness of the encoding of sequences of words). If ng(ieq1) = ng(ieq2),then ieq1 =ieq2.

REMARK 5.28.– (other encodings). A word or a sequence of words has a unique gn, but a set of n words (expressions) has n! possible gn. We will always consider sequences of words, as they each have a unique gn.

Other encodings are possible (and used), for example, the encoding of n-tuples, which is used in the proof of theorem 5.5. They are also called Gödel numbers.

We give a version of Gödel’s famous theorem that is particularly interesting in computer science.

THEOREM 5.13.– (Gödel’s first incompleteness theorem). There is no algorithm that can produce all true cwffs of arithmetic (i.e. without there being any false cwff in the list).

PROOF.– A sensible observation about this theorem is that if such an algorithm were to exist, in order to know whether a conjecture Conj holds or not in arithmetic, it would suffice to “sit and wait” for Conj or ¬Conj to be added to the list.

Proof technique: we assume that such an algorithm m exists and we construct a cwff that is true in arithmetic but is not in the output of M.

If n rev ieq, we will write ie208_01

where s denotes the successor function and 0 denotes itself. % For example, 4 : ssss0.

– We will say that a formula F(x) designates n rev ieq if the formula ie209_01 occurs in the output of M.

For example, if in the output of M we find

equ209_01.gif

then formula x + x = ssss0 designates the integer 2.

– Names are unique: imagine that this is not the case, for example, if the following cwffs occur in the output of M:

1) ie209_02

2) ie209_03

then, after replacing F(x) in (2) by the name it designates in (1) we obtain:

equ209_02

– If the number of symbols in our formalization of arithmetic is A (if there are infinitely many variables, they can be generated, e.g. by x and {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, x0, x1, x2, x3,…) there are at most Ai formulas containing i symbols.

For any m rev ieq, there are therefore finitely many numbers that are designated by formulas with at most m symbols. Thus, there are integers that are not designated by formulas of at most m symbols. Hence, there exists a least one integer that is not designated by such a formula (we order finitely many designated numbers and take the successor of the greatest designated number).

– We construct a formula C(x, y) meaning “x is a number that is designated by a formula containing z symbols”:

equ209_03

length being, for example, the program from example 6.17 feeding it as an input:

ie209_04.gif.

We could of course have used any other program that computes the length of a list18.

– Let B(x, y) denote the formula with the intended meaning: “x is designated by a formula containing less than y symbols”:

equ209_04

< is definable in arithmetic: ie209_05.

– Let A(x, y) denote the formula with the intended meaning: “x is the smallest number that is not designated by a formula containing less than y symbols”:

equ210_04

– Let k denote the number of symbols in A'(x, y). Of course (by inspection), k > 3 and let F(x) denote the formula with the intended meaning “x is the smallest number that cannot be named by a formula containing less than 10 × k symbols”:

equ210_01

Let us see how many symbols F(x) contains:

equ210_02

ie210_01 symbols

F(x) also contains the symbols re, y, (, y, x, =,), Λ,) image 10 symbols

F(x) thus contains a total of k + 22 symbols and as k > 3, k + 22 < 10 × k, thus F(x) contains less than 10 × k symbols.

– As mentioned above, there exists a smallest number among those that are not designated by a formula containing less than m symbols.

Let n be this number for m = 10 × k.

n is not designated by F(x), i.e.

ie210_02 is not among the outputs of M.

But (*) is a cwff that is true, as n is the smallest number that is not designated by a formula containing less than 10 × k symbols.

equ210_03

REMARK 5.29.– (incompleteness theorem and constructive mathematics). The notion of a proof is essential in constructive mathematics, as it is used to explain the meaning of existence.

From a constructivist point of view, to say that a proposition ef is true is equivalent to saying that we can find a proof of ef. Some authors call this identity the “To assert is to prove” principle:

A-P: ie211_01 (p is a proof of ef)

The following problem arises naturally: how can Tarski and Gödel’s results be reconciled with the principles on which constructivism is founded? In other words: what are these truths that cannot be proved (as according to A-P, truth coincides with proof)? The answer is that constructivists do not limit themselves to proofs in formal systems, but principle A-P refers to proofs that are correct from a constructivist point of view, knowing that provable means provable by any sound means and not provable in a given formal system.

There are therefore arithmetic truths that cannot be proved in a formal system, but that can be proved by correct means from a constructivist point of view.


1 It is interesting to note that in mathematics, a large majority of relations, denoted using predicates, are binary.

2 The expressive power of a logic depends on the objects that it permits us to consider (along with the possibility or not of quantifying these objects). The expressive power is obviously related to the properties of the logic itself ((un)decidability, etc.). See also section 9.3.

3 w is a substring of v iff there exist strings x, y (possibly empty) such that v = xwy.

4 Thus, if it contains occurrences of ¬, they are “next” to the atoms.

5 See also digressions 3.3 and 9.1.

6 In the Western world, since Parmenides and Aristotle.

7 The notion of truth is closely related to that of negation by the equation false = not true.

8 This is not the case, for example, with the statement “my head hurts”.

9 A closed statement is satisfied either by all assignments or by none, depending on whether it is true or false.

10 According to our definition, this is actually not a formal system: a formal language and formal inference rules are missing, but the context is clear enough and there is no ambiguity.

11 For example, the expression Let x denote a prime number translates into ieq.

12 If any two models of a theory are isomorphic, then the theory is categorical.

13 Irreflexive ieq non reflexive image.

14 Another possibility of automation is the use of heuristics, but in this case, we cannot guarantee that the procedure will halt with a correct answer in all the cases in which the formula has the expected property.

15 I.e. specify uncountably infinite sets and none other.

16 Should not be confused with Gödel’s incompleteness theorem, which is much more popular (see remark 3.28 and section 5.9).

17 Its classical version: a function is computable iff it is intuitively computable.

18 A program can be viewed as a sequence of instructions, each instruction can have a unique code, and the encoding of theorem 5.5 enables us to assign a unique natural number to a program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.67.235