THESIS ... - Alain Colmerauer

enable us to handle easily first order formulas. We show among other theories that the theory. Tad of ordered additive rational numbers is flexible and thus that ...
1MB taille 3 téléchargements 360 vues
THESIS presented at UNIVERSITÉ DE LA MÉDITERRANÉE AIX-MARSEILLE II École Doctorale de Mathématiques et d’Informatique de Marseille

by

Khalil Djelloul submitted for the degree of

Doctor of University of Aix-Marseille II in

COMPUTER SCIENCE

————————————————– Complete Theories Around Trees ————————————————– presented and defended publicly on June 15th, 2006 in front of the jury composed of M. M. M. M. M.

Nicolas Beldiceanu Alain Colmerauer François Fages Thom Fruehwirth Michel Rueher

Professor, École des mines de Nantes (examiner) Professor, Université de la Méditérranée (supervisor) Senior research scientist, INRIA Rocquencourt (reporter and president) Professor, University of ULM, Germany (reporter) Professor, Université de Nice Sophia Antipolis (examiner)

ii

Abstract The goal of this thesis is the study of a harmonious way to combine any first order theory with the theory of finite or infinite trees. For that: First of all, we introduce two classes of theories that we call infinite-decomposable and zeroinfinite-decomposable. We show that these theories are complete and accept a decision procedure which for every proposition gives either true or false. We show also that these classes of theories contain a large number of fundamental theories used in computer science, we can cite for example: the theory of additive rational or real numbers, the theory of the linear dense order without endpoints, the theory of finite or infinite trees, the construction of trees on an ordered set, and a combination of trees and ordered additive rational or real numbers. We give then an automatic way to combine any first order theory T with the theory of finite or infinite trees. A such hybrid theory is called extension into trees of the theory T and is denoted by T ∗ . After having defined the axiomatization of T ∗ using those of T , we define a new class of theories that we call flexible and show that if T is flexible then T ∗ is zero-infinite-decomposable and thus complete. The flexible theories are first order theories having elegant properties which enable us to handle easily first order formulas. We show among other theories that the theory ∗ of Tad of ordered additive rational numbers is flexible and thus that the extension into trees Tad Tad is complete. Finally, we end this thesis by a general algorithm for solving efficiently first order constraints ∗ . The algorithm is given in the form of 28 rewriting rules which transform every formula in Tad ϕ, which can possibly contain free variables, into a disjunction φ of solved formulas equivalent ∗ and such that φ is either the formula true, or the formula false, or a formula having to ϕ in Tad ∗ . Moreover, the at least one free variable and being equivalent neither to true nor to false in Tad solutions of the free variables of φ are expressed in a clear and explicit way in φ. Keywords: Theory of finite or infinite trees, Complete theory, Combination of theories, Solving first order constraints, Rewriting rules.

iii

iv

Contents Introduction

1

Chapter 1 Preliminaries

5

1.1

First order language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

1.2

Model and theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

1.2.1

Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6

1.2.2

Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

1.2.3

Complete theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

Chapter 2 Infinite-decomposable theory 2.1

Special quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

Vectorial quantifiers : ∃?, ∃! . . . . . . . . . . . . . . . . . . . . . . . . .

10

2.1.1 2.1.2 2.2

2.3

2.4

9

Infinite quantifier:

Ψ(u) ∃∞

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

Infinite-decomposable theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

2.2.1

Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

2.2.2

Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15

2.2.3

Fundamental examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

A decision procedure in infinite-decomposable theories . . . . . . . . . . . . . . .

24

2.3.1

Normalized formula

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

2.3.2

Working formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

26

2.3.3

The rewriting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

2.3.4

The decision procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

Application to the theory T of finite or infinite trees . . . . . . . . . . . . . . . .

35

2.4.1

The axioms of T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

2.4.2

Properties of T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

2.4.3

T is infinite-decomposable . . . . . . . . . . . . . . . . . . . . . . . . . . .

37

v

Contents 2.4.4 2.5

Solving first-order propositions in T

. . . . . . . . . . . . . . . . . . . . .

41

Discussion and partial conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . .

43

Chapter 3 Zero-infinite-decomposable theory Ψ(u)

45

3.1

Zero-infinite quantifier: ∃o ∞

. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46

3.2

Zero-infinite-decomposable theory . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

3.2.1

Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

3.2.2

Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

48

3.2.3

Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51

3.2.4

Fundamental example . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

53

A decision procedure in zero-infinite-decomposable theories . . . . . . . . . . . .

57

3.3.1

Normalized Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

57

3.3.2

Working formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

57

3.3.3

The rewriting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

60

3.3.4

The decision procedure

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

67

Application to the construction of trees on an ordered set Tord . . . . . . . . . . .

67

3.4.1

Axiomatization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

67

3.4.2

The standard model of Tord . . . . . . . . . . . . . . . . . . . . . . . . . .

69

3.4.3

Block and solved block in Tord . . . . . . . . . . . . . . . . . . . . . . . .

69

3.4.4

Tord is zero-infinite-decomposable . . . . . . . . . . . . . . . . . . . . . .

72

3.4.5

Solving first order propositions in Tord . . . . . . . . . . . . . . . . . . . .

76

Discussion and partial conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . .

79

3.3

3.4

3.5

Chapter 4 Extension into trees T ∗ of a first order theory T 4.1

4.2

Extension into trees T ∗ of T

. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

82

T∗

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

82

4.1.1

Axiomatization of

4.1.2

The standard model M ∗ of T ∗

. . . . . . . . . . . . . . . . . . . . . . . .

83

4.1.3

Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

84

Completeness of T ∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

86

4.2.1

Flexible theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

86

4.2.2

Blocks and solved blocks in T ∗ . . . . . . . . . . . . . . . . . . . . . . . .

87

4.2.3 4.3

vi

81

T∗

is zero-infinite-decomposable . . . . . . . . . . . . . . . . . . . . . . .

Extension into trees

∗ Tad

91

of ordered additive rational numbers . . . . . . . . . . .

97

4.3.1

Axiomatization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

97

4.3.2

Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

98

4.4

Discussion and partial conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

Chapter 5 ∗ Solving first order constraints in Tad

5.1

5.2

5.3

103

∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 First order constraint in Tad

5.1.1

∗ . . . . . . . . . . . . . . . . . . . . . . 103 A convenient axiomatization of Tad

5.1.2

∗ Example of first order constraint in Tad . . . . . . . . . . . . . . . . . . . 105

∗ . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Blocks and quantified blocks in Tad

5.2.1

∗ . . . . . . . . . . . . . . . . . . . . . . . . 105 Blocks and solved blocks in Tad

5.2.2

∗ . . . . . . . . . . . . . . . . . . . . . 107 Properties of the solved blocks in Tad

5.2.3

∗ . . . . . . . . . . . . . . . . . . 109 Decomposition of quantified blocks in Tad

∗ Solving first order constraints in Tad . . . . . . . . . . . . . . . . . . . . . . . . . 110

5.3.1

Working formulas and solved formulas . . . . . . . . . . . . . . . . . . . . 110

5.3.2

Main idea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

5.3.3

The rewriting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

5.3.4

The algorithm of resolution . . . . . . . . . . . . . . . . . . . . . . . . . . 124

Chapter 6 Conclusion Bibliography

127 129

vii

Contents

viii

Introduction The algebra of finite or infinite trees plays a fundamental role in computer science: it is a model for data structures, program schemes and program executions. As early as 1976, G. Huet proposed an algorithm for unifying infinite terms, that is solving equations in that algebra [28]. B. Courcelle has studied the properties of infinite trees in the scope of recursive program schemes [12]. A. Colmerauer has described the execution of Prolog II, III and IV programs in terms of solving equations and disequations in that algebra [5, 6, 1]. The unification of finite terms, i.e. the resolution of conjunctions of equations in the theory of finite trees has first been studied by A. Robinson [38]. Some better algorithms with better complexities have been proposed after by M.S. Paterson and M.N.Wegman [36] and A. Martelli and U. Montanari [35]. The resolution of conjunctions of equations in the theory of infinite trees has been studied by G. Huet [28], by A. Colmerauer [4, 5] and by J. Jaffar [29]. The resolution of conjunctions of equations and disequations in the theory of possibly infinite trees has been studied by A. Colmerauer [5] and H.J. Bürckert [2]. An incremental algorithm for solving conjunctions of equations and disequations on rational trees has been proposed after by V.Ramachandran and P. Van Hentenryck [37]. On the other hand, there exists an algorithm for elimination of quantifications which transforms a first-order formula into a boolean combination of simple constraints. We can refer to the work of M.J. Maher [33] and H. Comon [11]. M.J. Maher has axiomatized all the cases by complete first-order theories with infinite set of function symbols [33]. It is this theory which has been the starting point of our works. After having studied its properties we have created two classes of theories that we call infinitedecomposable and zero-infinite-decomposable and have shown that a lot of fundamental theories used in computer science belong to these classes. We can cite for example: the theory of finite trees, the theory of infinite trees, the theory of finite or infinite trees [19], the theory of the linear dense order without endpoints, the theory of additive rational or real numbers, the construction of trees on an ordered set [23] and the combination of finite or infinite trees and ordered additive rational or real numbers [24]. The first intuitions behind these classes of theories come from the works of T. Dao [16] which has proposed a general algorithm solving first order constraints in the theory of finite or infinite trees [16],[19] using a basic simplification of quantified conjunctions of atomic formulas. We have then generalized this simplification by showing that in every infinitedecomposable or zero-infinite-decomposable theory, it is always possible to decompose a series of existential quantifications on a conjunction of atomic formulas, into three embedded sequences having elegant properties which can be expressed using four special quantifiers denoted by ∃?, Ψ(u) Ψ(u) ∃!, ∃∞ , ∃o ∞ and called at-most-one, one-and-only-one, infinite and zero-infinite. While the Ψ(u) Ψ(u) quantifiers ∃?, ∃!, are just convenient notations, the quantifiers ∃∞ , ∃o ∞ express a property which can not be expressed in the first order level. The names infinite-decomposable and zeroinfinite-decomposable have not been chosen randomly. In fact, a zero-infinite decomposable Ψ(u) theory is decomposed using only the quantifiers ∃?, ∃!, ∃∞ , while a zero-infinite-decomposable 1

Introduction Ψ(u)

theory is decomposed using the quantifiers ∃?, ∃!, ∃o ∞ . After having studied the properties of these special quantifiers, we have show the completeness of all these classes of theories and given a decision procedure in the form of general rewriting rules which for every proposition give either true or false. We have then interested ourselves to the problem of combination of theories together with non-disjoint signatures and more exactly to the combination of any first order theory T with the theory of finite or infinite trees. This work reflects essentially to Prolog III and Prolog IV which have been modeled by A. Colmerauer [6] using a combination of trees, rational numbers, booleans and intervals. One of the major difficulties in this combination resides in the fact that the two combined theories can have non-disjoint signatures, i.e. the existence of at least one function or relation symbol having two completely different behaviors whether we handle the theory T or the theory of finite or infinite trees. Moreover, the theory of finite or infinite trees does not accept full elimination of quantifiers which makes the completeness of any combination with it not evident. For that, we would first to define a semantic meaning for this combination and then to give a harmonious axiomatization of the new hybrid theory. In our point of view, a combination of a theory T with the theory of finite or infinite trees is nothing other than an extension into trees of the elements of the models of the theory T . Thus, the axiomatization of the extension into trees of T , denoted by T ∗ , proceeds essentially from the axiomatization of the theory T and the three axioms of Michael Maher on the theory of finite or infinite trees [33] by introducing typing constraints that distinguish the tree elements from the others. To show the completeness of T ∗ , we have introduced the class of the flexible theories and shown that if T is flexible then its extension into trees, i.e. T ∗ , is a zero-infinite-decomposable theory and thus a complete theory. The flexible theories are first order theories having elegant properties which enable us to handle easily first order formulas. Once these results obtained, we have interested ourselves to build a general algorithm for solving first order hybrid constraints and which gives solutions of the free variables in a clear and explicit way. For us, solving a constraint ϕ, which can possibly contain free variables, in T ∗ , means to transform the first order formula ϕ into a disjunction φ of solved formulas, equivalent to ϕ in T ∗ and such that φ is, either the formula true, or the formula false, or a formula having at least one free variable and being equivalent neither to true nor to false in T ∗ . Of course, the two decision procedures given for the infinite-decomposable and zero-infinite-decomposable theories are not able to solve general first order constraints since they can only decide the validity or not validity of propositions (sentences). They are not able to express the solutions of the solved formula in a clear and explicit way and do not warrant that any disjunction of solved formulas containing at least one free variable is equivalent neither to true nor to false in T ∗ . We have ∗ of the theory T then chosen the extension into trees Tad ad of ordered additive rational numbers ∗ . One of the major and have given an efficient algorithm solving any first order constraint in Tad difficulties in this work resides in the fact that (1) every algorithm solving only propositions in the theory of finite or infinite trees has a non-elementary complexity in the form of tower of powers of 2 [41], (2) the theory of finite or infinite trees does not accept full elimination of quantifiers, (3) the function symbols + and − have two completely different behaviors whether they handle rationals or trees. For example, the individual +(1, 1) is the rational 2, while the individual +(1, f0 ) is the tree whose root is labeled + and whose suns are 1 and the tree reduced to a leaf labeled by f0 . This thesis contains five chapters followed by a conclusion. In Chapter 1 we recall the basic notions of first order logic and give a sufficient condition for the completeness of any first order theory. 2

In Chapter 2, we give a formal definition of the infinite-decomposable theories. The main idea behind this definition consists in decomposing any series of existential quantifications on a conjunction of atomic formulas, into three embedded sequences having elegant properties which Ψ(u) can be expressed using the special quantifiers ∃?, ∃!, ∃∞ . After having given the properties of these special quantifiers we show the completeness of any infinite-decomposable theory using the sufficient condition of completeness of first order theories given in Chapter 1. We give also a decision procedure in any infinite-decomposable theory T , in the form of five rewriting rules which for every proposition give either true or false in T . The correctness of our algorithm is another proof of the completeness of the infinite-decomposable theories. We end this chapter by an application to the theory T of finite or infinite trees. We show that T is infinite-decomposable and give two examples of solving propositions in T . In Chapter 3, we present the class of the zero-infinite-decomposable theories which is an extension of the infinite-decomposable theories by replacing the infinite quantifier by the zeroinfinite quantifier. We show the completeness of any zero-infinite-decomposable theory using the sufficient condition of completeness of first order theories given in Chapter 1. We give also a property which links the infinite-decomposable theories to the zero-infinite-decomposable theories and show that while all the infinite-decomposable theories given in Chapter 2 are also zeroinfinite-decomposable, the simple theory of the linear dense order is not infinite-decomposable but zero-infinite-decomposable. We present then a decision procedure for every zero-infinitedecomposable theory T , in the form of six rewriting rules which for every proposition give either true or false in T . This algorithm contains a new rule comparing with those of the infinitedecompsoable theories due to the zero-infnite quantifier which enables only a partial elimination of quantifiers while the infinite-quantifier enables a full elimination of quantifiers. We end this chapter by an application to the construction of trees on an ordered set. This theory, denoted by Tord , is a complete axiomatization of the construction of trees on a set of individuals together with a linear dense order relation without endpoints. After having presented the axiomatization of Tord , we show its zero-infinite-decomposability and end by an example solving propositions in Tord . In Chapter 4, we give an automatic way to combine any first order theory T with the theory of finite or infinite trees. The axiomatization of the extension into trees of T , denoted by T ∗ , is made essentially from the axiomatization of the theory T and the three axioms of Michael Maher of the theory of finite or infinite trees [33] as well as a full system of typing constraints. For each theory T ∗ we give a formal definition of the standard model M ∗ of T ∗ using the standard model M of T . To show the completeness of the theory T ∗ , we introduce the flexible theories and show that if T is flexible, then its extension into trees, i.e. T ∗ , is zero-infinite-decomposable and thus ∗ of the theory complete. We end this chapter by an application to the extension into trees Tad ∗ is complete. Tad of ordered additive rational numbers. We show that Tad is flexible and thus Tad Finally, in Chapter 5, we give a general algorithm solving any first order constraint in the ∗ . After having defined the meaning of a first order constraint in T ∗ , we present our theory Tad ad solver in the form of 28 rewriting rules which transform every formula ϕ into a disjunction φ of ∗ and such that φ is, either the formula true, or the formula solved formulas, equivalent to ϕ in Tad false, or a formula having at least one free variable and being equivalent neither to true nor to ∗ . While the two decision procedures given in Chapter 2 and 3 solve only propositions, false in Tad this algorithm gives the solutions of the free variables in a clear and explicit way and is able ∗ . It also to check if a formula having at least one free variable is always true or false in Tad warrants that every disjunction φ of solved formulas having at least one free variable accepts two ∗ of T ∗ we have M ∗ |= φ and explicit instantiations φ1 and φ2 such that for every model Mad 1 ad ad 3

Introduction ∗ |= ¬φ . We end this chapter by an example of solving a constraint having two free variables Mad 2 ∗ . and being always equivalent in false in Tad The sufficient condition for the completeness of first order theories given in Chapter 1, the Ψ(u) Ψ(u) quantifiers ∃∞ and ∃o ∞ , the classes of the infinite-decomposable and zero-infinite-decomposable ∗ theories, the extension into trees of first order theories, the flexible theories and the solver in Tad are our main contributions in this thesis.

4

Chapter 1

Preliminaries Contents 1.1 1.2

First order language Model and theory . 1.2.1 Model . . . . . . 1.2.2 Theory . . . . . 1.2.3 Complete theory

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 6 6 7 7

We present in this chapter the basic definitions of first order logic, model, theory and complete theory as well as a sufficient condition for the completeness of any first order theory.

1.1

First order language

We are given once and for all, an infinite countable set V of variables and the set L of logical symbols: =, true, false, ¬, ∧, ∨, →, ↔, ∀, ∃, (, ). We are also given once and for all, a signature S, i.e. a set of symbols partitioned into two subsets: the set of function symbols and the set of relation symbols. To each element s of S is linked a non-negative integer called arity of s. An n-ary symbol is a symbol with arity n. An 0-ary function symbol is called constant. A term or S-term is word on L ∪ S ∪ V , of one of the two following forms: x, f t1 . . . tn ,

(1.1)

with x taken from V , f an n-ary function symbol taken from F and the ti ’s shorter terms. A formula or S-formula is word on L ∪ S ∪ V of one of the eleven forms: s = t, rt1 . . . tn , true, false, ¬ϕ, (ϕ ∧ ψ), (ϕ ∨ ψ), (ϕ → ψ), (ϕ ↔ ψ), (∀x ϕ), (∃x ϕ),

(1.2)

with s and t terms, r an n-ary relation symbol taken from S and ϕ and ψ shorter formulas. The set of terms and formulas forms a first-order language with equality. The formulas of the first line of (1.2) are known as atomic, and flat if they are of one of the following forms: 5

Chapter 1. Preliminaries

true, false, x0 = x1 , x0 = f x1 ...xn , rx1 ...xn , where all the xi ’s are possibly non-distinct variables taken from V , f is an n-ary function symbol taken from S and r is an n-ary relation symbol taken from S. An equation is a formula of the form s = t with s and t terms. A relation is a formula of the form rt1 . . . tn with r an n-ary relation symbol taken from S and the ti ’s terms. An occurrence of a variable x in a formula is bound if it occurs in a sub-formula of the form (∀x ϕ) or (∃x ϕ). It is free in the contrary case. The free variables of a formula are those which have at least one free occurrence in this formula. A proposition or a sentence is a formula without free variables. If ϕ is a formula, then we denote by var(ϕ) the set of the free variables of ϕ. The syntax of the formulas being constraining, we allowed ourselves to use infix notations for the binary symbols and to add and remove brackets when there are no ambiguities. We do not distinguish two formulas which can be made equal using the following transformations of the sub-formulas: ϕ ∧ ψ =⇒ ψ ∧ ϕ, (ϕ ∧ ψ) ∧ φ =⇒ ϕ ∧ (ψ ∧ φ), ϕ ∧ true =⇒ ϕ, ϕ ∨ false =⇒ ϕ. If I is the set {i1 , ..., in }, we call conjunction of formulas and write i∈I ϕi , each formula of V the form ϕi1 ∧ ϕi2 ∧ ... ∧ ϕin ∧ true. In particular, for I = ∅, the conjunction i∈I ϕi is reduced to true. We denote by F L the set of the conjunctions of flat formulas. We denote by AT the set of the conjunctions of atomic formulas. A set Ψ of formulas is closed for the conjunction if for each formula ϕ ∈ Ψ and each formula φ ∈ Ψ, the formula ϕ ∧ φ belongs to Ψ. All theses considerations will be useful for the algorithm of resolution given in section 4. V

1.2 1.2.1

Model and theory Model

A model or S-model is a 3-tuple M = (M, F, R), where M is a nonempty set disjoint from S, its elements are called individuals of M ; F and R are sets of functions and relations in M, subscripted by the elements of S. More exactly, if F and R are denoted by (f M )f ∈F respectively (rM )r∈R then: • M, the universe or domain of M , is a nonempty set disjoint from S, its elements are called individuals of M ; • for every n-ary function symbol f taken from F , f M is an n-ary operation in M, i.e. an application from Mn in M. In particular, when f is a constant, f M belongs to M; • for every n-ary relation symbol r taken from R, rM is an n-ary relation in M, i.e. a subset of Mn . Let M = (M, F, R) be a model. An M -formula ϕ is a formula built on the signature S ∪ M instead of S, by considering the elements of M as 0-ary function symbols. If for each free variable x of ϕ, we replace each free occurrence of x by a same element in M, we get an M -formula called instantiation or valuation of ϕ by individuals of M . If ϕ is a M -formula, we say that ϕ is true in M and we write M |= ϕ, 6

(1.3)

1.2. Model and theory iff for any instantiation ϕ0 of ϕ by individuals of M , the set M has the property expressed by ϕ0, when we interpret the function and relation symbols of ϕ0 by the corresponding functions and relations of M and when we give to the logical symbols their usual meaning. Remark 1.2.1.1 For every M -formula ϕ without free variables, one and only one of the following properties holds: M |= ϕ, M |= ¬ϕ. Let us finish this sub-section by a convenient notation. Let x ¯ = x1 ...xn be a word on V and let ¯i = i1 ...in be a word on M or V of the same length as x ¯. If ϕ(¯ x) and φ are two M -formulas, then we denote by ϕ(¯i), respectively φx¯←¯i , the M -formula obtained by replacing in ϕ(¯ x), respectively in φ, each free occurrence of xj by ij

1.2.2

Theory

A theory is a (possibly infinite) set of propositions called axioms. We say that the model M is a model of T , iff for each element ϕ of T , M |= ϕ. If ϕ is a formula, we write T |= ϕ, iff for each model M of T , M |= ϕ. We say that the formulas ϕ and ψ are equivalent in T iff T |= ϕ ↔ ψ. A set Ψ of formulas is called T -closed if: • Ψ ⊆ AT , • Ψ is closed for the conjunction, • every flat formula ϕ is equivalent in T to a formula which belongs to Ψ and does not contain other free variables than those of ϕ. The sets AT and F L are T -closed in any theory T . This notion of T -closed set is useful when we need to transform formulas of F L into formulas which belong to Ψ. The transformation of normalized formulas to working formulas defined in Section 2.3.2 illustrates this notion.

1.2.3

Complete theory

A theory T is complete iff for every proposition ϕ, one and only one of the following properties holds: T |= ϕ, T |= ¬ϕ. Let us present now a sufficient condition for the completeness of any first-order theory. We will use the abbreviation wnfv for “without new free variables ". A formula ϕ is equivalent to a wnfv formula ψ in T means that T |= ϕ ↔ ψ and ψ does not contain other free variables than those of ϕ. Property 1.2.3.1 A theory T is complete if there exists a set of formulas, called basic formulas, such that: 1. every flat formula is equivalent in T to a wnfv Boolean combination of basic formulas, 2. every basic formula without free variables is equivalent in T , either to true or to false, 3. every formula of the form ∃x ((

V

i∈I

ϕi ) ∧ (

V

i∈I 0

¬ϕi )),

(1.4)

where the ϕi ’s are basic formulas, is equivalent in T to a wnfv Boolean combination of basic formulas. 7

Chapter 1. Preliminaries

Proof. Let Φ be the set of all the formulas which are equivalent in T to a wnfv Boolean combination of basic formulas. Let us show first that every formula ψ belongs to Φ. Let us make a proof by induction on the syntactic structure of ψ. Without losing generalities we can restrict ourselves to the cases where ψ contains only flat formulas and the following logical symbols1 : ¬, ∧, ∃. If ψ is a flat formula, then ψ ∈ Φ according to the first condition of the property. If ψ is of the form ¬ϕ1 or ϕ1 ∧ ϕ2 , with ϕ1 , ϕ2 ∈ Φ, then ψ ∈ Φ according to the definition of Φ. If ψ is of the form ∃x ϕ, with ϕ ∈ Φ, then according to the definition of Φ, the formula ϕ is equivalent to a wnfv formula ϕ0 , which is a Boolean combination of basic formulas ϕij . Without losing generalities we can suppose that ϕ0 is of the form ϕ0 =

W

V

i∈I ((

j∈J

ϕij ) ∧ (

V

j∈J 0

¬ϕij )).

(1.5)

By distributing the existential quantifier, the formula ∃x ϕ0 is equivalent in T to W

V

i∈I (∃x ((

j∈J

ϕij ) ∧ (

V

j∈J 0

¬ϕij ))),

(1.6)

which, according to the third condition of the property, belongs to Φ. Thus the formula ∃x ϕ, i.e. ψ, belongs to Φ. Let now ψ be a proposition. According to what we have just shown ψ ∈ Φ. Thus, the formula ψ is equivalent in T to a Boolean combination of basic formulas without free variables. According to the second condition of the property, one and only one of the following properties holds: T |= ψ, T |= ¬ψ. Thus T is a complete theory.2 This sufficient condition is interesting in sense that it reasons on the syntactic structure of first-order formulas and not on the semantic meaning of function and relation symbols of the theory. Informally, the basic formulas are generally formulas of the form ∃¯ xα with α ∈ AT . Corollary 1.2.3.2 If T satisfies the three conditions of Property 1.2.3.1 then every formula is equivalent in T to a wnfv Boolean combination of basic formulas. This corollary is a consequence of the proof of Property 1.2.3.1 in which we have shown that if Φ is the set of all the formulas which are equivalent in T to a wnfv Boolean combination of basic formulas then every formula ψ belongs to Φ.

1 Since each atomic formula is equivalent in the empty theory to a quantified conjunction of flat formulas and each formula is equivalent in the empty theory to a formula which contains only the logical symbols: ∃, ∧, ¬.

8

Chapter 2

Infinite-decomposable theory Contents 2.1

Special quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1.1 Vectorial quantifiers : ∃?, ∃! . . . . . . . . . . . . . . . . . . . . . . . . 10 Ψ(u)

2.2

2.3

2.4

2.5

2.1.2 Infinite quantifier: ∃∞ . . . . . . . . . . . . . . . . . . . Infinite-decomposable theory . . . . . . . . . . . . . . . . 2.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Fundamental examples . . . . . . . . . . . . . . . . . . . . A decision procedure in infinite-decomposable theories . 2.3.1 Normalized formula . . . . . . . . . . . . . . . . . . . . . 2.3.2 Working formula . . . . . . . . . . . . . . . . . . . . . . . 2.3.3 The rewriting rules . . . . . . . . . . . . . . . . . . . . . . 2.3.4 The decision procedure . . . . . . . . . . . . . . . . . . . Application to the theory T of finite or infinite trees . . 2.4.1 The axioms of T . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Properties of T . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 T is infinite-decomposable . . . . . . . . . . . . . . . . . . 2.4.4 Solving first-order propositions in T . . . . . . . . . . . . Discussion and partial conclusion . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12 13 13 15 17 24 24 26 29 35 35 35 35 37 41 43

We present in this chapter a formal definition of the infinite-decomposable theories. The main idea behind this definition consists in decomposing each quantified conjunction of atomic formulas into three embedded sequences of quantifications having very particular properties, which can Ψ(u) be expressed with the help of three special quantifiers denoted by ∃?, ∃!, ∃∞ and called atmost-one, exactly-one, infinite. We show the completeness of these theories using the sufficient condition defined in Chapter 1, and give some examples of fundamental infinite-decomposable theories. We present also a decision procedure in every infnite-decomposable theory T , in the form of five rewriting rules which transform any formula ϕ, which can possibly contain free variables, into a wnfv conjunction φ of solved formulas, equivalent to ϕ in T and such that φ is, V either the formula true, or the formula i∈I ¬true, or a formula having at least one free variable and being easily transformable into a boolean combination of conjunctions of quantified atomic formulas. In particular, if ϕ has no free variables then φ is either the formula true, or the formula 9

Chapter 2. Infinite-decomposable theory ¬true. The correctness of our algorithm is another proof of the completeness of the decomposable theories. We end this chapter by an application to the theory T of finite or infinite trees. We show that T is infinite-decomposable and give two examples of solving first order propositions in T . Note that the results presented in this chapter have been published in: [18], [19], [22].

2.1 2.1.1

Special quantifiers Vectorial quantifiers : ∃?, ∃!

Let M be a model and let T be a theory. Let x ¯ = x1 . . . xn and y¯ = y1 . . . yn be two words on V of the same length. Let ψ, φ, ϕ and ϕ(¯ x) be M -formulas. We write ∃¯ xϕ ∀¯ xϕ ∃?¯ x ϕ(¯ x) ∃!¯ xϕ

for for for for

∃x1 ...∃xn ϕ, ∀x1 ...∀xn ϕ, V ∀¯ x∀¯ y ϕ(¯ x) ∧ ϕ(¯ y ) → i∈{1,...,n} xi = yi , (∃¯ x ϕ) ∧ (∃?¯ x ϕ).

The word x ¯, which can be the empty word ε, is called vector of variables. Note that the formulas ∃?εϕ and ∃!εϕ are respectively equivalent to true and to ϕ in any model M . Notation 2.1.1.1 Let Q be a vectorial quantifier taken from {∀, ∃, ∃!, ∃?}. Let x ¯ be vector of variables taken from V . Let ϕ and φ be formulas. We write: Q¯ x ϕ ∧ φ f or Q¯ x (ϕ ∧ φ). Example 2.1.1.2 Let I = {1, ..., n} be a finite set. Let ϕ and φi with i ∈ I be formulas. Let x ¯ and y¯i with i ∈ I be vectors of variables. We write: ∃¯ x ϕ ∧ ¬φ1 ∀¯ x ϕ ∧ φ1 V ∃!¯ x ϕ ∧ i∈I (∃¯ yi φi ) V ∃?¯ x ϕ ∧ i∈I ¬(∃¯ yi φi )

for for for for

∃¯ x (ϕ ∧ ¬φ1 ), ∀¯ x (ϕ ∧ φ1 ), ∃!¯ x (ϕ ∧ (∃¯ y1 φ1 ) ∧ ... ∧ (∃¯ yn φn ) ∧ true), ∃?¯ x (ϕ ∧ (¬(∃¯ y1 φ1 )) ∧ ... ∧ (¬(∃¯ yn φn )) ∧ true).

Property 2.1.1.3 If T |= ∃?¯ x ϕ then T |= (∃¯ x ϕ ∧ ¬φ) ↔ ((∃¯ xϕ) ∧ ¬(∃¯ x ϕ ∧ φ)).

(2.1)

Proof. Let M be a model of T and let ∃¯ x ϕ0 ∧ ¬φ0 be an instantiation of ∃¯ x ϕ ∧ ¬φ by 0 individuals of M . Let us denote by ϕ1 the M -formula (∃¯ x ϕ0 ∧ ¬φ0 ) and by ϕ02 the M -formula (∃¯ x ϕ0 ) ∧ ¬(∃¯ xϕ0 ∧ φ0 ). To show the equivalence (2.1), it is enough to show that M |= ϕ01 ↔ ϕ02 .

(2.2)

If M |= ¬(∃¯ x ϕ0 ) then M |= ¬ϕ01 and M |= ¬ϕ02 , thus the equivalence (2.2) holds. If M |= ∃¯ x ϕ0 . Since T |= ∃?¯ x ϕ0 , there exists a unique vector ¯i of individuals of M such that M |= ϕ0x¯←¯i . Two cases arise: If M |= ¬(φ0x¯←¯i ), then M |= (ϕ0 ∧ ¬φ0 )x¯←¯i , thus M |= ϕ01 . Since ¯i is unique and since M |= ¬(φ0x¯←¯i ), there exists no vector u ¯ of individuals of M such that M |= (ϕ0 ∧ φ0 )x¯←¯u . 0 0 Consequently, M |= ¬(∃¯ x ϕ ∧ φ ) and thus M |= ϕ02 . We have M |= ϕ01 and M |= ϕ02 , thus, the equivalence (2.2) holds. 10

2.1. Special quantifiers If M |= φ0x¯←¯i , then M |= (ϕ0 ∧ φ0 )x¯←¯i and thus M |= ¬ϕ02 . Since ¯i is unique and since M |= φ0x¯←¯i , there exists no vector u ¯ of individuals of M such that M |= (ϕ0 ∧ ¬φ0 )x¯←¯u . Consequently, 0 0 M |= ¬(∃¯ x ϕ ∧¬φ ) and thus M |= ¬ϕ01 . We have M |= ¬ϕ01 and M |= ¬ϕ02 , thus, the equivalence (2.2) holds.2 Corollary 2.1.1.4 If T |= ∃?¯ x ϕ then T |= (∃¯ xϕ ∧

^

¬φi ) ↔ ((∃¯ xϕ) ∧

i∈I

^

¬(∃¯ x ϕ ∧ φi )).

i∈I

Proof. Let ψ be the formula ¬( i∈I ¬φi ). The formula ∃¯ x ϕ ∧ i∈I ¬φi , is equivalent in T to ∃¯ x ϕ ∧ ¬ψ. Since T |= ∃?¯ x ϕ, then according to Property 2.1.1.3 the preceding formula is V equivalent in T to (∃¯ x ϕ)∧¬(∃¯ x ϕ∧ψ), which is equivalent in T to (∃¯ x ϕ)∧¬(∃¯ x ϕ∧¬( i∈I ¬φi )), W W thus to (∃¯ x ϕ) ∧ ¬(∃¯ x ϕ ∧ ( i∈I φi )), which is equivalent in T to (∃¯ x ϕ) ∧ ¬(∃¯ x ( i∈I (ϕ ∧ φi ))), W thus to (∃¯ x ϕ) ∧ ¬( i∈I (∃¯ x ϕ ∧ φi )), which is finally equivalent in T to V

(∃¯ x ϕ) ∧

V

^

¬(∃¯ x ϕ ∧ φi ).

i∈I

2 Property 2.1.1.5 If T |= ∃?¯ y φ and if all the variables of y¯ has no free occurrences in ϕ then 



(∃¯ x ϕ ∧ ¬(∃¯ y φ))   ∨ T |= (∃¯ x ϕ ∧ ¬(∃¯ y φ ∧ ψ)) ↔  . (∃xy ϕ ∧ φ ∧ ¬ψ)

(2.3)

Proof. The formula ∃¯ x ϕ ∧ ¬(∃¯ y φ ∧ ψ), is equivalent in T to ∃¯ x ϕ ∧ ¬(∃¯ y φ ∧ ¬(¬ψ)), which according to Property 2.1.1.3 is equivalent in T to ∃¯ x ϕ ∧ ¬((∃¯ y φ) ∧ ¬(∃¯ y φ ∧ ¬ψ)), i.e. to ∃¯ x ϕ ∧ ((¬(∃¯ y φ)) ∨ (∃¯ y φ ∧ ¬ψ)), i.e. to





(∃¯ x ϕ ∧ ¬(∃¯ y φ))   ∨  . (∃¯ x ϕ ∧ (∃¯ y φ ∧ ¬ψ)) Since all the variables of y¯ has no free occurrences in ϕ, then the preceding formula is equivalent in T to   (∃¯ x ϕ ∧ ¬(∃¯ y φ))   ∨  . (∃¯ xy¯ ϕ ∧ φ ∧ ¬ψ) 2 11

Chapter 2. Infinite-decomposable theory Property 2.1.1.6 If T |= ∃!¯ x ϕ then T |= (∃¯ x ϕ ∧ ¬φ) ↔ ¬(∃¯ x ϕ ∧ φ). Corollary 2.1.1.7 If T |= ∃!¯ x ϕ then T |= (∃¯ xϕ ∧

^

¬φi ) ↔

^

¬(∃¯ x ϕ ∧ φi ).

i∈I

i∈I

Corollary 2.1.1.8 If T |= ψ → (∃!¯ x ϕ) then T |= (ψ ∧ (∃¯ xϕ ∧

^

¬φi )) ↔ (ψ ∧

i∈I

2.1.2

^

¬(∃¯ x ϕ ∧ φi )).

i∈I

Infinite quantifier: ∃Ψ(u) ∞

Let M be a model. Let T be a theory. Let ϕ(x) be a M -formula and let Ψ(u) be a set of formulas having at most u as free variable. Definition 2.1.2.1 We write M |= ∃Ψ(u) ∞ x ϕ(x),

(2.4)

iff for each instantiation ∃x ϕ0 (x) of ∃x ϕ(x) by individuals of M and for each finite subset {ψ1 (u), .., ψn (u)} of elements of Ψ(u), the set of the individuals i of M such that M |= ϕ0 (i) ∧ V j∈{1,...,n} ¬ψj (i) is infinite. Ψ(u)

We write T |= ∃∞ x ϕ(x), iff for each model M of T we have (2.4). This infinite quantifier holds only for infinite models, i.e. models whose set of elements are infinite. Note that if Ψ(u) = {false} then (2.4) simply means that M contains an infinite set of individuals i such that ϕ(i). Informally, the notation (2.4) states that there exists a full V elimination of quantifiers in formulas of the form ∃x ϕ(x) ∧ j∈{1,...,n} ¬ψj (x) due to an infinite set of distinct values of x in M which satisfy this formula. The intuitions behind this definition V come from an aim to eliminate all the quantifiers in formulas of the form ∃¯ x ϕ ∧ i∈I ¬φi where I is a finite (possibly empty) set and the φi are formulas which do not accept elimination of quantifiers. The theory of finite or infinite trees presented in Section 2.4 is a good example of theory which does not accept full elimination of quantifiers. The set Ψ(u) contains in this case formulas of the form ∃¯ x y = f (¯ x) which can not be reduced anymore. Property 2.1.2.2 Let J be a finite (possibly empty) set and let ϕ(x) and ϕj (x) be M -formulas Ψ(u) with j ∈ J. If T |= ∃∞ x ϕ(x) and if for each ϕj (x), at least one of the following properties holds: • T |= ∃?x ϕj (x), • there exists ψj (u) ∈ Ψ(u) such that T |= ∀x ϕj (x) → ψj (x), then T |= ∃x ϕ(x) ∧ 12

V

j∈J

¬ϕj (x)

2.2. Infinite-decomposable theory

Proof. Let M be a model of T and let ∃x ϕ0 (x) ∧ j∈J ¬ϕ0j (x) be an instantiation of ∃x ϕ(x) ∧ V j∈J ¬ϕj (x) by individuals of M . Suppose that the conditions of Property 2.1.2.2 hold and let us show that V M |= ∃x ϕ0 (x) ∧ j∈J ¬ϕ0j (x). (2.5) V

Let J 0 be the set of the j ∈ J such that M |= ∃?x ϕ0j (x) and let m be the cardinality of J 0 . Since for all j ∈ J 0 , M |= ∃?x ϕ0j (x), then for each set M0 of individuals of M such that Cardinality(M0 ) > m, there exists i ∈ M0 such that M |=

^

¬ϕ0j (i).

(2.6)

j∈J 0 Ψ(u)

On the other hand, since T |= ∃∞ x ϕ(x) and according to Definition 2.1.2.1 we know that for each finite subset {ψ1 (u), ..., ψn (u)} of Ψ(u), the set of the individuals i of M such that V M |= ϕ0 (i)∧ nk=1 ¬ψk (i) is infinite. Since for all j ∈ J −J 0 we have M |= ∀x ϕj (x) → ψj (x), thus, M |= ∀x (¬ψj (x)) → (¬ϕj (x)), then there exists an infinite set ξ of individuals i of M such that V M |= ϕ0 (i) ∧ j∈J−J 0 ¬ϕ0j (i). Since ξ is infinite then Cardinality(ξ) > m, and thus according V to (2.6) there exists at least an individual i ∈ ξ such that M |= ϕ0 (i) ∧ ( j∈J−J 0 ¬ϕ0j (i)) ∧ V ( k∈J 0 ¬ϕ0k (i)). Thus, we have M |= ∃x ϕ0 (x) ∧

^

¬ϕ0j (x).

j∈J

2 Ψ(u)

Ψ(u)

Property 2.1.2.3 If T |= ∃∞ x ϕ(x) then T |= ∃∞ x true. Ψ(u)

Ψ(u)

Proof. Let M be a model of T . If T |= ∃∞ x ϕ(x) then M |= ∃∞ x ϕ(x). According to V Definition 2.1.2.1 there exists an infinite set of individuals i such that M |= ϕ(i) ∧ j∈J ¬ϕj (i) with ϕj (u) ∈ Ψ(u) for all j ∈ J. Thus there exists an infinite set of individuals i such that V Ψ(u) Ψ(u) M |= true ∧ j∈J ¬ϕj (i), i.e. M |= ∃∞ x true and thus T |= ∃∞ x true. 2

2.2

Infinite-decomposable theory

2.2.1

Definition

Definition 2.2.1.1 A theory T having at least one model is called infnite-decomposable or quit simply decomposable, if there exists a set Ψ(u) of formulas having at most u as free variable, a T -closed set A and three sets A0 , A00 and A000 of formulas of the form ∃¯ xα with α ∈ A such that: 1. Every formula of the form ∃¯ x α ∧ ψ, with α ∈ A and ψ any formula, is equivalent in T to a wnfv decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧ ψ)), with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 and ∃¯ x000 α000 ∈ A000 . 2. If ∃¯ x0 α0 ∈ A0 then T |= ∃?¯ x0 α0 and for each free variable y in ∃¯ x0 α0 , at least one of the following properties holds: 13

Chapter 2. Infinite-decomposable theory • T |= ∃?y¯ x0 α0 , • there exists ψ(u) ∈ Ψ(u) such that T |= ∀y (∃¯ x0 α0 ) → ψ(y). Ψ(u)

3. If ∃¯ x00 α00 ∈ A00 then for each x00i of x ¯00 we have T |= ∃∞ x00i α00 . 4. If ∃¯ x000 α000 ∈ A000 then T |= ∃!¯ x000 α000 . 5. If the formula ∃¯ x0 α0 belongs to A0 and has no free variables then this formula is either the formula ∃εtrue or ∃εfalse. Since A is T -closed, then A is a sub-set of AT . While the formulas of A00 and A000 accept full Ψ(u) elimination of quantifiers according to the properties of the quantifiers ∃! and ∃∞ , the formulas of A0 can possibly do not accept elimination of quantifiers. This is due to the second point of Definition 2.2.1.1 which states that T |= ∃?¯ x0 α0 . The computation of the sets A, A0 , A00 , A000 and Ψ(u) for a theory T depends on the axiomatization of T . Generally, it is enough to know solving a formula of the form ∃¯ xα with α ∈ F L to get a first intuition on the sets A0 , A00 , A000 and Ψ(u). Informally, the sets A0 , A00 and A000 can be called according to their linked vectorial quantifier, i.e. A0 is the at most one solution set and contains formulas which accept at most one solution in T and possibly do not accept full elimination of quantifiers, the set A00 is the infinite instantiation set and contains formulas that accept an infinite set of solutions in T . The set A000 is the unique solution set and contains formulas which have one and only solution in T . The set Ψ(u) contains generally simple formulas of the form ∃¯ xα with at most one free variable and α ∈ A. It can also be reduced for example to the set {f aux}. Note that the sets A0 and A000 are generally not empty since for each model M of any theory T we have M |= ∃?ε x = y and M |= ∃!x x = y. Property 2.2.1.2 Let T be a decomposable theory. Every formula of the form ∃¯ x α, with α ∈ A, 0 0 0 0 0 is equivalent in T to a wnfv formula of the form ∃¯ x α with ∃¯ xα ∈A. Proof. Let ∃¯ x α be a formula with α ∈ A. According to Definition 2.2.1.1 this formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 )), with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 and ∃¯ x000 α000 ∈ A000 . Since ∃¯ x000 α000 ∈ A000 then according to Definition 2.2.1.1 T |= ∃!¯ x000 α000 and thus using Corollary 2.1.1.7 (with φ = false) the preceding formula is equivalent in T to ∃¯ x0 α0 ∧ (∃¯ x00 α00 ), which is equivalent in T to ∃¯ x0 α0 ∧ (∃x001 ...x00n−1 (∃x00n α00 )). Ψ(u)

Since ∃¯ x00 α00 ∈ A00 then according to Definition 2.2.1.1 we have T |= ∃∞ x00n α00 and thus T |= ∃ x00n α00 . The preceding formula is equivalent in T to ∃¯ x0 α0 ∧ (∃x001 ...x00n−1 true), which is finally equivalent in T to ∃¯ x0 α0 . 2 Using Property 2.2.1.2 and the fifth point of Definition 2.2.1.1 we get 14

2.2. Infinite-decomposable theory Corollary 2.2.1.3 Let T be a decomposable theory. Every formula, without free variables, of the form ∃¯ x α, with α ∈ A, is equivalent in T either to true or to false. Proof. Let ∃¯ x α be a proposition with α ∈ A. According to Property 2.2.1.2, this proposition is equivalent in T to a proposition of the form ∃¯ x0 α0 which belongs to A0 . According to the last point of Definition 2.2.1.1, this proposition is of the form ∃ε true or ∃ε false. Since T has at least one model, then either T |= ∃¯ x α, or T |= ¬(∃¯ x α). The condition that T has at least a mode is vital ! In fact, if T has no models then we can have T |= true ↔ false and thus we have both T |= ∃¯ x α and T |= ¬(∃¯ x α). 2

2.2.2

Completeness

Theorem 2.2.2.1 If T is decomposable then T is complete.

Proof. Let T be a decomposable theory which satisfies the five conditions of Definition 2.2.1.1. Let us show that T is complete using Property 1.2.3.1 and by taking formulas of the form ∃¯ x α, with α ∈ A, as basic formulas. Note that according to Definition 2.2.1.1, the sets A0 , A00 and A000 contain formulas of the form ∃¯ xα with α ∈ A. Let us show that the first condition of Property 1.2.3.1 holds, i.e. every flat formula is equivalent to a Boolean combination of basic formulas. According to Definition 2.2.1.1 the set A is T -closed, i.e. (i) A is closed for the conjunction, (ii) every flat formula is equivalent in T to a formula which belongs to A. Let α be a flat formula. According to (ii) α is equivalent in T to a formula β which belongs to A. Since β is equivalent in T to ∃ε β and β ∈ A then α is equivalent to a basic formula2 . Thus, the first condition of Property 1.2.3.1 holds. Let us show that the second condition of Property 1.2.3.1 holds, i.e. every basic formula without free variables is either equivalent to true or to false in T . Let ∃¯ x α with α ∈ A be a basic formula without free variables. According to Corollary 2.2.1.3 either T |= ∃¯ xα or T |= ¬(∃¯ x α). Thus, the second condition of Property 1.2.3.1 holds. Let us show now that the third condition of Property 1.2.3.1 holds, i.e. every formula of the form V V ∃x ( i∈I (∃¯ xi αi )) ∧ ( j∈J ¬(∃¯ yj βj )), (2.7) with αi ∈ A for all i ∈ I and βj ∈ A for all j ∈ J, is equivalent in T to a wnfv Boolean combination of basic formulas, i.e. to a wnfv Boolean combination of formulas of the form ∃¯ xα with α ∈ A. By lifting all the quantifications ∃¯ xi after having possibly renamed the variables which appear in each x ¯i , the formula (2.7) is equivalent in T to a wnfv formula of the form ∃¯ x(

V

i∈I

αi ) ∧

V

j∈J

¬(∃¯ yj βj ),

with αi ∈ A for all i ∈ I and βj ∈ A for all j ∈ J. According to Definition 2.2.1.1 the set A is T -closed and thus closed under conjunction. The preceding formula is equivalent in T to a wnfv formula of the form V ∃¯ x α ∧ j∈J ¬(∃¯ yj βj ), with α ∈ A and βj ∈ A for all j ∈ J. According to the first point of Definition 2.2.1.1 the preceding formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧ 2

V

j∈J

¬(∃¯ yj βj ))),

Of course a basic formula is a particular case of a Boolean combination of basic formulas.

15

Chapter 2. Infinite-decomposable theory with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 , ∃¯ x000 α000 ∈ A000 and βj ∈ A for all j ∈ J. Since ∃¯ x000 α000 ∈ A000 then according to the fourth point of Definition 2.2.1.1 T |= ∃!¯ x000 α00 . Thus, using Corollary 2.1.1.7 the preceding formula is equivalent in T to ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

V

j∈J

¬(∃¯ x000 α000 ∧ (∃¯ yj βj ))).

By lifting all the quantifies ∃¯ yj after having possibly renamed the variables which appear in each y¯j , the preceding formula is equivalent in T to ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

V

j∈J

¬(∃¯ x000 ∃¯ yj α000 ∧ βj )).

According to Definition 2.2.1.1 the sets A0 , A00 and A000 contain formulas of the form ∃¯ xα with α ∈ A, thus α000 ∈ A. Since βj ∈ A for all j ∈ J and since A is T -closed (i.e. closed for the conjunction...) then for all j ∈ J the formula α000 ∧ βj belongs to A. Thus, the preceding formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

V

j∈J

¬(∃¯ yj βj )),

with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 , and βj ∈ A for all j ∈ J. According to Corollary 2.2.1.2 the preceding formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

V

j∈J

¬(∃¯ yj0 βj0 )),

with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 , and ∃¯ yj0 βj0 ∈ A0 for all j ∈ J. Let us denote by J1 , the set of the j ∈ J such that x00n does not have free occurrences in the formula ∃¯ yj0 βj0 . Thus, the preceding formula is equivalent in T to 0

0

∃¯ x α ∧

(∃x001 ...∃x00n−1

" V

#

( j∈J1 ¬(∃¯ y 0 β 0 ))∧ Vj j ). 00 00 (∃xn α ∧ j∈J−J1 ¬(∃¯ yj0 βj0 ))

(2.8)

Since ∃¯ x00 α00 ∈ A00 and ∃¯ yj0 βj0 ∈ A0 , then according to Property 2.1.2.2 and the points 2 and 3 of Definition 2.2.1.1, the formula (2.8) is equivalent in T to ∃¯ x0 α0 ∧ (∃x001 ...∃x00n−1 (true ∧

V

j∈J1

¬(∃¯ yj0 βj0 ))).

By repeating the three preceding steps (n − 1) times, by denoting by Jk the set of the j ∈ Jk−1 such that x00(n−k+1) does not have free occurrences in ∃¯ yj0 βj0 , and by using (n − 1) times Property 2.1.2.3, the preceding formula is equivalent in T to ∃¯ x0 α0 ∧

V

j∈Jn

¬(∃¯ yj0 βj0 ).

Since ∃¯ x0 α0 ∈ A0 then according to the second point of Definition 2.2.1.1 T |= ∃?¯ x0 α0 . Thus, using Corollary 2.1.1.4 the preceding formula is equivalent in T to (∃¯ x0 α0 ) ∧

V

j∈Jn

¬(∃¯ x0 α0 ∧ (∃¯ yj0 βj0 )).

By lifting all the quantifies ∃¯ yj after having possibly renamed the variables which appear in each y¯j , the preceding formula is equivalent in T to (∃¯ x0 α0 ) ∧ 16

V

j∈Jn

¬(∃¯ x0 ∃¯ yj0 α0 ∧ βj0 ).

2.2. Infinite-decomposable theory According to Definition 2.2.1.1 the sets A0 , A00 and A000 contain formulas of the form ∃¯ xα with 0 0 0 0 0 0 0 α ∈ A. Thus, since ∃¯ x α ∈ A and ∃¯ yj βj ∈ A for all j ∈ Jn , then α ∈ A and βj ∈ A for all j ∈ Jn . Since the set A is T -closed, it is closed for the conjunction, then for all j ∈ Jn the formula α0 ∧ βj0 belongs to A and thus, the preceding formula is equivalent in T a wnfv formula of the form V (∃¯ x α) ∧ j∈Jn ¬(∃¯ yj βj ), with α ∈ A and βj ∈ A for all j ∈ Jn . This formula is a Boolean combination of formulas of the form ∃¯ xα with α ∈ A, i.e. a Boolean combination of basic formulas. Note that we have never added new free variables and we have renamed only the quantified variables. Thus, the third condition of Property 1.2.3.1 holds. Since T satisfies the three conditions of Property 1.2.3.1, then T is a complete theory. 2 According to Theorem 2.2.2.1 and Corollary 1.2.3.2, we have the following corollary: Corollary 2.2.2.2 If T is decomposable and if for all ∃¯ x0 α0 ∈ A0 we have x ¯0 = ε, then T accepts full elimination of quantifiers. Proof. Let T a decomposable theory such that for all ∃¯ x0 α0 ∈ A0 we have x ¯0 = ε. Let ϕ be a formula which can possibly contain free variables. In the proof of Theorem 2.2.2.1 we have shown that T satisfies the three conditions of Property 1.2.3.1 using formulas of the forms ∃¯ xα with α ∈ A as basic formulas. Thus, according to Corollary 1.2.3.2, the formula ϕ is equivalent in T to a wnfv Boolean combination of basic formulas, i.e. Boolean combination of formulas of the form ∃¯ xα with α ∈ A. According to Property 2.2.1.2 each of these basic formulas is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 which belongs to A0 . Since for all ∃¯ x0 α0 ∈ A0 we have x ¯0 = ε and since α0 ∈ A (according to the structure of the set A0 defined in Definition 2.2.1.1) then the formula ϕ is equivalent in T to a boolean combination of elements of A. Since T is decomposable then A is a T -closed set and thus A ⊆ AT . Then, the formula ϕ is equivalent in T to a wnfv boolean combination φ of conjunctions of atomic formulas. According to the syntax of the atomic formulas defined in Section 2, it is clear that φ does not contain quantifiers. 2 This corollary makes the connection between the set A0 and the notion of full elimination of quantifiers. In fact, if T is decomposable and does not accept full elimination of quantifiers then it is enough to add axioms to T which enable to eliminate all the quantifications of the formulas of A0 to get a full elimination quantifiers theory. The sets A00 and A000 are not concerned by this notion since in any decomposable theory T the formulas of A00 and A000 accept full elimination Ψ(u) of quantifiers due to their associated vectorial quantifiers: ∃! and ∃∞ . On the other hand, if T is a decomposable theory which satisfies Corollary 2.2.2.2 then we can interest ourself to get the smallest sub-set T ∗ of axioms of T , such that T ∗ still accepts full elimination of quantifiers. For that is is enough to remove axiom by axiom from T and check each time if the theory still satisfies Corollary 2.2.2.2. This corollary shows also the fact that a decomposable theory T does not means that T admits full elimination of quantifiers. In fact, the theories of infinite trees, finite trees and finite or infinite trees as defined by M. Maher [33] do not accept full elimination of quantifier but are decomposable and thus complete [19].

2.2.3

Fundamental examples

We present in this sub-section two examples of simples decomposable theories. The first one is a simple axiomatization of an infinite set of distinct individuals with an empty set of function and relation symbols. This theory denoted by Eq can be seen as a small extension of the Clark 17

Chapter 2. Infinite-decomposable theory equational theory CET [3], even if according to our syntax the equality symbol is considered as a primitive logical symbol together with its usual properties (commutativity, transitivity ...). The second theory is the theory of additive rational or real numbers with addition and subtraction. The goal of these examples is to show the decomposability of simple theories whose properties are well known and do not need addition of proofs. An other example of a non-simple decomposable theory (finite or infinite trees) is given in Section 2.4 with a detailed study of the properties of this theory. Let us assume for all this sub-section that the variables of V are ordered by a strict linear dense order relation without endpoints denoted by .

Equality theory Let Eq be a theory together with an empty set of function and relation symbols and whose axioms is the infinite set of propositions of the following form (1n ) ∀x1 ...∀xn ∃y ¬(x1 = y) ∧ ... ∧ ¬(xn = y),

(2.9)

where all the variables x1 ...xn are distinct and (n 6= 0). The form (2.9) is called diagram of axiom and for each value of n there exists an axiom of Eq. For example the following property is true in Eq: Eq |= ∃x ¬(x = y) ∧ ¬(x = z). The theory Eq has as model an infinite set of distinct individuals. Note that since Eq has an empty set of function and relation symbols, then AT = F L and thus all the equations of Eq are flat equations. Let x and y be two distinct variables. We call leader of the equation x = y the variable x. A conjunction α of flat formulas is called ()-solved in Eq if: (1) false is not a sub-formula of α, (2) all the equations of α are of the form x = y with3 x  y, (3) each equation of α has a distinct leader which does not occur in the other equations of α. Property 2.2.3.1 Every conjunction of flat formulas is equivalent in Eq either to false or to a ()-solved conjunction of equations. Let x, y and z be variables such that x  y  z. The conjunction x = x ∧ y = z is not ()-solved because in the equation x = x we have x 6 x. By the same way, the conjunction x = y ∧ y = z is not ()-solved because y is leader in y = z and occurs also in x = y. The conjunctions true and x = z ∧ y = z are ()-solved. The computation of a possibly ()-solved conjunction of equations from a conjunction of flat formulas in Eq is evident4 and proceeds using the usual properties of the equality (commutativity, substitution, transitivity... ) and by replacing each formula of the form x = x and α ∧ false by true respectively by false. Property 2.2.3.2 Let α be a ()-solved conjunction of equations and x ¯ the vector of the leaders of the equations of α. We have: 1. Eq |= ∃!¯ x α. 3

Recall that  is a strict linear dense order relation and thus x 6 x. In other terms x = x is not ()-solved.

4

(1) y = x =⇒ x = y. (2) x = y ∧ x = z =⇒ x = y ∧ z = y. (3) x = y ∧ z = x =⇒ x = y ∧ z = y. (4) false ∧ α =⇒ false. (5) x = x =⇒ true. The rules (1), (2) and (3) are applied only if x  y.

18

2.2. Infinite-decomposable theory {f aux}

2. Eq |= ∃∞

x true.

3. For all x ∈ var(α) we have Eq |= ∃?x α. The first point holds because all the leaders of the equations of α are distinct and have one and only occurrence in α. Thus, for each instantiation of the right hand sides of each equation, there exists one and only one value for the left hand sides and thus for the leaders. The second point is a consequence of the diagram of axiom (2.9) which states that for every finite set of distinct variables x1 ...xn there exists a variable y which is different from all the xi . Thus, in each model of Eq there exists an infinite set of individuals. Thus according to Definition 2.1.2.1 we have {f aux} Eq |= ∃∞ x true. The third point holds since in a ()-solved conjunction of equations we have no formulas of the form x = x (because x 6 x). Thus, using the properties of the equality for each model of Eq and for each instantiation of the variables of var(α) − {x} either there exists a unique solution of x or there exists a contradiction in the instantiations and thus there exists no values for x. Property 2.2.3.3 The theory Eq is decomposable. Proof. We show that Eq satisfies the conditions of Definition 2.2.1.1. The sets A, A0 , A00 , A000 and Ψ(u) are chosen as follows: • A is the set F L. • A0 is the set of formulas of the form ∃ε α0 where α0 is either a ()-solved conjunction of equations or the formula false. • A00 is the set of formulas of the form ∃¯ x00 true. • A000 is the set of formulas of the form ∃¯ x000 α000 with α000 a ()-solved conjunction of equations 000 and x ¯ the vector of the leaders of the equations of α000 . • Ψ(u) = {false}. It is obvious that F L is Eq-closed and A0 , A00 and A000 contain formulas of the form ∃¯ x α with α ∈ F L. Let us show that Eq satisfies the first condition of Definition 2.2.1.1. Let α ∈ F L and ψ a formula. Let x ¯ be a vector of variables. Let us choose an order  such that the variables of x ¯ are greater than the free variables of ∃¯ x α. According to Property 2.2.3.1 two cases arise: Either α is equivalent to false in Eq and thus the formula ∃¯ xα ∧ ψ is equivalent in Eq to a decomposed formula of the form ∃ε false ∧ (∃ε true ∧ (∃ε true ∧ ψ)). Or, α is equivalent in Eq to a ()-solved conjunction β of flat formulas. Let Xl be the set of the variables of x ¯ which are leader in the equations of β. Let Xn be the set of the variables of x ¯ which are not leader in the equations of β. The formula ∃¯ xα ∧ ψ is equivalent in Eq to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧ ψ)),

(2.10)

with x ¯0 = ε. The formula α0 contains the conjunction of the equations of β whose leaders do not belong to Xl , i.e. whose leaders are free in ∃¯ xβ. The vector x ¯00 contains the variables of Xn . The 19

Chapter 2. Infinite-decomposable theory formula α00 is the formula true. The vector x ¯000 contains the variables of Xl . The formula α000 is the conjunction of the equations of β whose leaders belong to Xl . According to our construction it is clear that ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 and ∃¯ x000 α ∈ A000 . Let us show that (2.10) and ∃¯ xα ∧ ψ 0 00 000 are equivalent in Eq. Let X, X , X and X be the sets of the variables of the vectors5 x ¯, x ¯0 , x ¯00 and x ¯000 . If α is equivalent to false in Eq then the equivalence of the decomposition is evident. Else β is a ()-solved conjunction of equations and thus according to our construction we have: X = X 0 ∪ X 00 ∪ X 000 , X 0 ∩ X 00 = ∅, X 0 ∩ X 000 = ∅, X 00 ∩ X 000 = ∅, X 0 = ∅, for all x00i ∈ X 00 we 000 000 0 00 have x00i 6∈ var(α0 ) and for all x000 i ∈ X we have xi 6∈ var(α ∧ α ). This is due to the definition of the ()-solved conjunction of flat formulas and the order  which has been chosen such that the quantified variables of ∃¯ x α are greater than the free variables of ∃¯ x α. On the other hand, each equation in β occurs in α0 ∧ α00 ∧ α000 and each equation in α0 ∧ α00 ∧ α000 occurs in β and thus Eq |= β ↔ (α0 ∧ α00 ∧ α000 ). We have shown that the vectorial quantifications are coherent and the equivalence Eq |= β ↔ α0 ∧ α00 ∧ α000 holds. According to Property 2.2.3.1 we have Eq |= α ↔ β and thus, the decomposition keeps the equivalence in Eq. Let us decompose for example ∃xyz v = w ∧ z = z ∧ z = x ∧ v = y. Let us choose the order  such that x  y  z  v  w. Let us ()-solve the conjunction v = w ∧ z = z ∧ z = x ∧ v = y. Thus the preceding formula is equivalent in Eq to ∃xyz v = w ∧ x = z ∧ y = w. Finally this formula is equivalent to the following decomposed formula ∃ε v = w ∧ (∃z true ∧ (∃xy x = z ∧ y = w)). The theory Eq satisfies the second condition of Definition 2.2.1.1 according to the third point of Property 2.2.3.2 and using the fact that x ¯0 = ε. The theory Eq satisfies the third condition of Definition 2.2.1.1 according to the second point of Property 2.2.3.2. The theory Eq satisfies the fourth condition of Definition 2.2.1.1 according to the first point of Property 2.2.3.2. The theory Eq satisfies the last condition of Definition 2.2.1.1 because A0 is of the form ∃ε α0 where α0 is either the formula false or a ()-solved conjunction of equations. Thus, if ∃ε α0 has no free variables, then either α0 = true or α0 = false. 2 Note that Eq accepts full elimination of quantifiers. In fact Corollary 2.2.2.2 illustrates this result since for all ∃¯ x0 α0 ∈ A0 we have x ¯0 = ε.

Additive rational or real numbers theory Let F = {+, −, 0, 1} a set of function symbols of respective arities 2, 1, 0, 0. Let R = ∅ an empty set of relation symbols. Let Ra be the theory of additive rational or real numbers together with addition and subtraction. Let a be a positive integer and t1 , ..., tn terms. Notation 2.2.3.4 We denote by: • Z the set of the integers. • t1 + t2 , the term +t1 t2 . • t1 + t2 + t3 , the term +t1 (+t2 t3 ). 5

20

Of course if x ¯ = ε then X = ∅

2.2. Infinite-decomposable theory • −a.t1 , the term (−t1 ) + · · · + (−t1 ). |

{z a

}

• 0.t1 , the term 0. • a.t1 , the term t1 + · · · + t1 , |



{z

}

a

Pn

the term t1 + t2 + ... + tn + 0, where t1 + t2 + ... + tn is the term t1 + t2 + ... + tn P in which we have removed all the ti ’s which are equal to 0. For n = 0 the term ni=1 ti is reduced to the term 0. i=1 ti ,

The axiomatization of Ra is the set of propositions of one of the 8 following forms: 1 2 3 4 5n 6n 7 8

∀x∀y x + y = y + x, ∀x∀y∀z x + (y + z) = (x + y) + z, ∀x x + 0 = x, ∀x x + (−x) = 0, ∀x n.x = 0 → x = 0, ∀x ∃!y n.y = x, ∀x∀y∀z (x = y) ↔ (x + z = y + z), ¬(0 = 1).

with n an non-null integer. This theory has two usual models: rational numbers Q with addition and subtraction in Q and real numbers R with addition and subtraction in R. P We call block every conjunction α of formulas of the form: true, false, ni=1 ai .xi = a0 .1 with x1 , ..., xn distinct variables and ai ∈ Z for all i ∈ {0, 1, ..., n}. We call leader of an equation of P the form ni=1 ai .xi = a0 .1 the greatest variables xk (k ∈ {1, ..., n}) according to the order  such that ak 6= 0. A block α is called ()-solved in Ra if (1) each equation of α has a distinct leader which does not occur in the other equations of α and (2) α does not contain sub-formulas of the form 0 = a0 .1 or false with a0 ∈ Z. According to the axiomatization of Ra we show easily that: Property 2.2.3.5 For all k ∈ {1, ..., n} we have: Ra |=

n X i=1

ai .xi = a0 .1 ↔ ak .xk =

n X

(−ai ).xi + a0 .1

i=1,i6=k

Property 2.2.3.6 Every block is equivalent in Ra either to false or to a ()-solved block. Let x, y and z be variables such that x  y  z. The block 2.x + y = (−1).1 ∧ 2.z + y = 3.1 is not ()-solved because y is leader in the second equation and occurs also in the first one. By the same way, the block x + y = 3.1 ∧ 0 = 0.1 is not ()-solved because 0 = 0.1 occurs in it. The blocks true and x + 2.z = 2.1 ∧ 3.y + 2.z = 3.1 are ()-solved. The computation of a possibly ()-solved block is evident6 and proceeds using Property 2.2.3.5 and a usual technique of substitution and simplification by replacing each equation of the form 0 = a0 .1 by false if a0 6= 0 and by true otherwise and every formula of the form false ∧ α by false. 6

(1) 0 = 0.1 =⇒ true. (2)0 = a0.1 =⇒ false. (3) false ∧ α =⇒ false.  Pn Pn a .x = a0 .1∧ ai .xi = a0 .1∧ i=1 i i . (4) Pn =⇒ Pi=1 n b .x = b0 .1 (b a − ak bi ).xi = (bk a0 − ak b0 ).1 i=1 i i i=1 k i In the rule (2) a0 6= 0. In the rule (4) xk is the leader of the block

Pn i=1

ai .xi = a0 .1 and bk 6= 0.

21

Chapter 2. Infinite-decomposable theory Property 2.2.3.7 Let α be a ()-solved block and x ¯ be the vector of the leaders of the equations of α. We have: 1. Ra |= ∃!¯ x α. {f aux}

2. Ra |= ∃∞

x true.

3. For all x ∈ var(α) we have Ra |= ∃?x α. The first point holds because all the leaders are distinct and do not occur in the other equations. P Thus, if we transform each equation of the form ni=1 ai .xi = a0 .1 using Property 2.2.3.5 into a Pn formula of the form ak .xk = i=1 (−ai ).xi + a0 .1 with xk the leader of this equation, then we get a conjunction of equations whose left hand sides are distinct and do not occur in the right hand sides. Thus, for each instantiation of the right hand sides of these equations there exists one and only value for the left hand sides and thus for the leaders according to Axiom 6 of Ra. The second point holds because according to the axiom 8 we have Ra |= ¬(0 = 1) thus using the axiom 7 we have Ra |= ¬(0 + 1 = 1 + 1). Then using the axiom 3 we get Ra |= ¬(1 = 1 + 1). Thus using the transitivity of the equality we have Ra |= ¬(0 = 1 + 1). If we repeat the preceding steps n times we get n different individuals in each model of Ra. Thus for every model of Ra there exists an {f aux} infinite set of individuals. Thus according to Definition 2.1.2.1 we have Ra |= ∃∞ x true. The third point is evident according to the form of the blocks and the definition of the ()-solved block. Property 2.2.3.8 The theory Ra is decomposable. Proof. We show that Ra satisfies the conditions of Definition 2.2.1.1. The sets A, A0 , A00 , A000 and Ψ(u) are chosen as follows: • A is the set of blocks. • A0 is the set of formulas of the form ∃ε α0 where α0 is either a ()-solved block or the formula false. • A00 is the set of formulas of the form ∃¯ x00 true. • A000 is the set of formulas of the form ∃¯ x000 α000 with α000 a ()-solved block and x ¯000 the vector 000 of the leaders of the equations of α . • Ψ(u) = {false}. Let us denote by BL the set of blocks. It is clear that A0 , A00 and A000 contain formulas of the form ∃¯ x α with α ∈ BL. Let us show that BL is Ra-closed. According to the definition of BL we have BL ⊆ AT . On the other hand BL is closed for the conjunction. Finally, if α is a flat formula then : if it is the formula true, false, x = 0 or x = 1 then it is already a block7 , else, the following rules8 transform α into a block: x=y =⇒ x + (−1).y = 0.1 x = −y =⇒ x + y = 0.1 x = y + z =⇒ x + (−1).y + (−1).z = 0.1 7 8

22

Because according to Notation 2.2.3.4 the notations 0.1, 1.1 and 1.x represent the terms 0, 1 and x respectively. These rules are true in Ra and deduced from the axiomatization of Ra

2.2. Infinite-decomposable theory Thus, BL is Ra-closed. Let us show that Ra satisfies the first condition of Definition 2.2.1.1. Let α ∈ BL and ψ a formula. Let x ¯ be a vector of variables. Let us choose an order  such that the variables of x ¯ are greater than the free variables of ∃¯ x α. According to Property 2.2.3.6 two cases arise: Either α is equivalent to false in Ra and thus the formula ∃¯ xα ∧ ψ is equivalent in Ra to a decomposed formula of the form ∃ε false ∧ (∃ε true ∧ (∃ε true ∧ ψ)). Or, α is equivalent in T to a ()-solved block β. Then, let Xl be the set of the variables of x ¯ which are leader in the equations of β. Let Xn be the set of the variables of x ¯ which are not leader in the equations of β. The formula ∃¯ xα ∧ ψ is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧ ψ)), (2.11) with x ¯0 = ε. The formula α0 contains the conjunction of the equations of β whose leaders do not belong to Xl , i.e. whose leaders are free in ∃¯ xβ. The vector x ¯00 contains the variables of Xn . The formula α00 is the formula true. The vector x ¯000 contains the variables of Xl . The formula α000 is the conjunction of the equations of β whose leaders belong to Xl . According to our construction it is clear that ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 and ∃¯ x000 α ∈ A000 . Let us show that (2.11) and ∃¯ xα ∧ ψ 0 00 000 are equivalent in Ra. Let X, X , X and X be the sets of the variables of the vectors x ¯, x ¯0 , x ¯00 000 and x ¯ . If α is equivalent to false in Ra then the equivalence of the decomposition is evident. Else β is a ()-solved block and thus according to our construction we have: X = X 0 ∪ X 00 ∪ X 000 , X 0 ∩ X 00 = ∅, X 0 ∩ X 000 = ∅, X 00 ∩ X 000 = ∅, X 0 = ∅, for all x00i ∈ X 00 we have x00i 6∈ var(α0 ) and 000 we have x000 6∈ var(α0 ∧ α00 ). This is due to the definition of ()-solved blocks for all x000 i ∈ X i and the order  which has been chosen such that the quantified variables of ∃¯ x α are greater than the free variables of ∃¯ x α. On the other hand, each equation of β occurs in α0 ∧ α00 ∧ α000 and each equation in α0 ∧ α00 ∧ α000 occurs in β and thus Ra |= β ↔ (α0 ∧ α00 ∧ α000 ). We have shown that the vectorial quantifications are coherent and the equivalence Ra |= β ↔ α0 ∧ α00 ∧ α000 holds. According to Property 2.2.3.6 we have Ra |= α ↔ β and thus, the decomposition keeps the equivalence in Ra. Let us decompose for example ∃xyz 2.v + w = 3.1 ∧ v + x = 2.1 ∧ v + x + 2.z = 4.1 Let us choose the order  such that x  y  z  v  w. Let us ()-solve the block 2.v + w = 3.1 ∧ v + x = 2.1 ∧ v + x + 2.z = 4.1. Thus the preceding formula is equivalent in Ra to ∃xyz 2.v + w = 3.1 ∧ 2.x + (−1).w = 1 ∧ z = 1 Finally this formula is equivalent to the following decomposed formula ∃ε 2.v + w = 3.1 ∧ (∃y true ∧ (∃xz 2.x + (−1).w = 1 ∧ z = 1)). The theory Ra satisfies the second condition of Definition 2.2.1.1 according to the third point of Property 2.2.3.7 and using the fact that x ¯0 = ε. The theory Ra satisfies the third condition of Definition 2.2.1.1 according to the second point of Property 2.2.3.7. The theory Ra satisfies the fourth condition of Definition 2.2.1.1 according to the first point of Property 2.2.3.7. The theory Ra satisfies the last condition of Definition 2.2.1.1 because A0 is of the form ∃ε α0 where α0 is either a ()-solved block or the formula false. Thus, if α0 does not contain free variables then according to the definition of the ()-solved blocks α0 does not contain formulas of the form 0 = a0 1 and thus α0 is either the formula true or the formula false. 2 Note that Ra accepts full elimination of quantifiers. In fact Corollary 2.2.2.2 illustrates this result since for all ∃¯ x0 α0 ∈ A0 we have x ¯0 = ε. 23

Chapter 2. Infinite-decomposable theory

2.3

A decision procedure in infinite-decomposable theories

Let T be a decomposable theory together with its set of function symbols F and its set of relation symbols R. The sets Ψ(u), A, A0 , A00 and A000 are now known and fixed.

2.3.1

Normalized formula

Definition 2.3.1.1 A normalized formula ϕ of depth d ≥ 1 is a formula of the form ¬(∃¯ xα ∧

^

ϕi ),

(2.12)

i∈I

with I a finite (possibly empty) set, α ∈ F L and the ϕ0i s are normalized formulas of depth di with d = 1 + max{0, d1 , ..., dn } and all the quantified variables of ϕ have distinct names and different from the names of the free variables. Example 2.3.1.2 Let f and g two 1-ary function symbol which belong to F . The formula "

"

¬ ∃εtrue ∧

¬(∃x y = f x ∧ x = y ∧ ¬(∃ε y = gx))∧ ¬(∃ε x = z)

##

is a normalized formula of depth equals to three. The formulas ¬(∃ε true) and ¬(∃ε false) are two normalized formulas of depth 1. The smallest value of a depth of a normalized formula is 1. Normalized formulas of depth 0 are not defined and do not exist. Property 2.3.1.3 Every formula ϕ is equivalent in T to a wnfv normalized formula of depth d ≥ 1.

Proof. It is easy to transform any formula into a wnfv normalized formula, it is enough for example to follow the followings steps: 1. Introduce a supplement of equations and existentially quantified variables to transform the conjunctions of equations and relations into conjunctions of flat formulas. 2. Express all the quantifiers, constants and logical connectors with ¬, ∧ and ∃, using the following transformations9 of sub-formulas : (ϕ ∨ φ) (ϕ → φ) (ϕ ↔ φ) (∀x ϕ)

=⇒ =⇒ =⇒ =⇒

¬(¬ϕ ∧ ¬φ), ¬(ϕ ∧ ¬φ), (¬(ϕ ∧ ¬φ) ∧ ¬(φ ∧ ¬ϕ)), ¬(∃x ¬ϕ).

3. If the formula ϕ obtained does not start with the logical symbol ¬, then replace it by ¬(∃ε true ∧ ¬ϕ). 4. Name the quantified variables by distinct names and different from the names of the free variables. 5. Lift the quantifier before the conjunction, i.e. ϕ ∧ (∃¯ x ψ) or (∃¯ x ψ) ∧ ϕ, becomes ∃¯ xϕ ∧ ψ because the free variables of ϕ are distinct from those of x ¯. 9

24

These equivalences are true in the empty theory and thus in any theory T .

2.3. A decision procedure in infinite-decomposable theories 6. Group quantified variables into a vectorial quantifier, i.e. ∃¯ x(∃¯ y ϕ) or ∃¯ x∃¯ y ϕ becomes ∃xy ϕ. 7. Insert empty vectors and formulas of the form true to get the normalized form using the following transformations of sub-formulas: ¬(

^

i∈I

¬(α ∧

¬ϕi ),

(2.13)

i∈I

^ i∈I

¬(∃¯ x

^

¬ϕi ) =⇒ ¬(∃ε true ∧

^ j∈J

¬ϕi ) =⇒ ¬(∃ε α ∧

^

¬ϕi ),

(2.14)

i∈I

¬ϕj ) =⇒ ¬(∃¯ x true ∧

^

¬ϕj ).

(2.15)

j∈J

with α ∈ F L, I a finite (possibly empty) set and J a finite non-empty set. If the starting formula does not contain the logical symbol ↔ then this transformation will be linear, i.e. there exists a constant k such that n2 ≤ kn1 , where n1 is the size of the starting formula and n2 the size of the normalized formula. We show easily by contradiction that the final formula obtained after application of these steps is normalized. 2 Example 2.3.1.4 Let f be a 2-ary function symbols which belong to F . Let us apply the preceding steps to transform the following formula into a normalized formula which is equivalent in T: (f uv = f wu ∧ (∃x u = x)) ∨ (∃u ∀w u = f vw). Note that the formula does not start with ¬ and the variables u and w are free in f uv = f wu ∧ (∃x u = x) and bound in ∃u ∀w u = f vw. Step 1: Let us first transform the equations into flat equations. The preceding formula is equivalent in T to (∃u1 u1 = f uv ∧ u1 = f wu ∧ (∃x u = x)) ∨ (∃u ∀w u = f vw). (2.16) Step 2: Let us now express the quantifier ∀ with ¬, ∧ and ∃. Thus, the formula (2.16) is equivalent in T to (∃u1 u1 = f uv ∧ u1 = f wu ∧ (∃x u = x)) ∨ (∃u ¬(∃w ¬(u = f vw))). Let us also express the logical symbol ∨ with ¬, ∧ and ∃. The preceding formula is equivalent in T to ¬(¬(∃u1 u1 = f uv ∧ u1 = f wu ∧ (∃x u = x)) ∧ ¬(∃u ¬(∃w ¬(u = f vw)))).

(2.17)

Step 3: The formula starts with ¬, then we move to Step 4. Step 4: The quantified variables u and w in (∃u ¬(∃w ¬(u = f vw))) must be renamed. Thus, the formula (2.17) is equivalent in T to ¬(¬(∃u1 u1 = f uv ∧ u1 = f wu ∧ (∃x u = x)) ∧ ¬(∃u2 ¬(∃w1 ¬(u2 = f vw1 )))). Step 5: By lifting the existential quantifier ∃x, the preceding formula is equivalent in T to ¬(¬(∃u1 ∃x u1 = f uv ∧ u1 = f wu ∧ u = x) ∧ ¬(∃u2 ¬(∃w1 ¬(u2 = f vw1 )))). 25

Chapter 2. Infinite-decomposable theory Step 6: Let us group the two quantified variables x and u1 into a vectorial quantifier. Thus, the preceding formula is equivalent in T to ¬(¬(∃u1 x u1 = f uv ∧ u1 = f wu ∧ u = x) ∧ ¬(∃u2 ¬(∃w1 ¬(u2 = f vw1 )))). Step 7: Let us introduces empty vectors of variables and formulas of the form true to get the normalized formula. According to the rule (2.13), the preceding formula is equivalent in T to "

"

¬ ∃ε true ∧

¬(∃u1 x u1 = f uv ∧ u1 = f wu ∧ u = x)∧ ¬(∃u2 ¬(∃w1 ¬(u2 = f vw1 )))

##

,

then using the rule (2.14) it is equivalent to "

"

¬ ∃ε true ∧

¬(∃u1 x u1 = f uv ∧ u1 = f wu ∧ u = x)∧ ¬(∃u2 ¬(∃w1 ¬(∃ε u2 = f vw1 )))

##

,

and finally using the rule (2.15) it is equivalent to "

"

¬ ∃ε true ∧

¬(∃u1 x u1 = f uv ∧ u1 = f wu ∧ u = x)∧ ¬(∃u2 true ∧ ¬(∃w1 true ∧ ¬(∃ε u2 = f vw1 )))

##

,

This is a normalized formula of depth 4.

2.3.2

Working formula

Definition 2.3.2.1 A working formula ϕ of depth d ≥ 1 is a formula of the form ¬(∃¯ xα ∧

^

ϕi ),

(2.18)

i∈I

with I a finite (possibly empty) set, α ∈ A and the ϕ0i s are working formulas of depth di with d = 1 + max{0, d1 , ..., dn } and all the quantified variables of ϕ have distinct names and different from the names of the free variables. Property 2.3.2.2 Every formula is equivalent in T to a wnfv working formula.

Proof. Let ϕ be a formula. According to Property 2.3.1.3 ϕ is equivalent in T to a wnfv normalized formula φ of the form ^ ¬(∃¯ xα ∧ ϕi ), (2.19) i∈I

with α ∈ F L and all the ϕi are normalized formulas. Since T is decomposable then according to Definition 2.2.1.1 the set A is T -closed, i.e. (i) A ⊆ AT , (ii) A is closed for the conjunction and (iii) every flat formula is equivalent in T to a formula which belongs to A. Since α ∈ F L, then according to (iii) α is equivalent in T to a conjunction β of elements of A. According to (ii) β belongs to A. Thus, the formula (2.19) is equivalent in T to ¬(∃¯ xβ ∧

^

ϕi ),

(2.20)

i∈I

with β ∈ A. By repeating the preceding steps recursively on each sub-normalized formula ϕi of (2.20) we get a working formula. 2 26

2.3. A decision procedure in infinite-decomposable theories Example 2.3.2.3 In the theory Ra of additive rational numbers, the formula "

"

¬ ∃ε true ∧

¬(∃x y = −z ∧ z = x + y)∧ ¬(∃ true ∧ ¬(∃w true ∧ ¬(∃ε z = w)))

##

,

is a normalized formula of depth 4 which is equivalent in Ra to the following working formula "

"

¬ ∃ε true ∧

¬(∃x y + z = 0.1 ∧ z + (−1).x + (−1).y = 0.1)∧ ¬(∃ true ∧ ¬(∃w true ∧ ¬(∃ε z + (−1).w = 0.1)))

##

.

The formula ¬(∃ε z + (−1).w = 0.1) is a sub-working formula. Definition 2.3.2.4 A solved formula is a working formula of the form ¬(∃¯ x0 α0 ∧

^

¬(∃¯ yi0 βi0 )),

(2.21)

i∈I

∃¯ x0 α0

with I a finite (possibly empty) set, ∈ A0 , ∃¯ yi0 βi0 ∈ A0 for all i ∈ I, α0 different from the formula false and all the βi0 are different from the formulas true and false. Property 2.3.2.5 Let ϕ be a conjunction of solved formulas without free variables. The conjunction ϕ is either the formula ¬true or the formula true. V

Proof. Recall first that we write i∈I ϕi , and call conjunction each formula of the form ϕi1 ∧ ϕi2 ∧ ... ∧ ϕin ∧ true. Let ϕ be a conjunction of solved formulas without free variables. According to Definition 2.3.2.4, ϕ is of the form (

^

¬(∃¯ x0i αi0 ∧

i∈I

^

0 0 ¬(∃¯ yij βij ))) ∧ true

(2.22)

j∈Ji

with 1. I a finite (possibly empty) set, 2. (∃¯ x0i αi0 ) ∈ A0 for all i ∈ I, 0 β 0 ) ∈ A0 for all i ∈ I and j ∈ J , 3. (∃¯ yij i ij

4. αi0 different from false for all i ∈ I, 0 different from true and false for all i ∈ I and j ∈ J . 5. βij i

Since these solved formulas don’t have free variables and since T is a decomposable theory then according to the fifth point of Definition 2.2.1.1 of a decomposable theory and the conditions 2 and 3 of (2.22) we have: 0 β 0 is either the formula ∃εtrue or ∃εfalse. (*) each formula ∃¯ x0i αi0 and each formula ∃¯ yij ij According to (*) and the condition 5 of (2.22), all the sets Ji must be empty, thus ϕ is of the form ^ ( ¬(∃¯ x0i αi0 )) ∧ true (2.23) i∈I

According to (*) and (2.23), the formula ϕ is of the form (

^

i∈I 0

¬(∃εfalse)) ∧ (

^

¬(∃εtrue)) ∧ true

j∈I−I 0

27

Chapter 2. Infinite-decomposable theory According to the condition 4 of (2.22), the set I 0 must be empty and thus ϕ is of the form (

^

¬(∃εtrue)) ∧ true

i∈I

If I = ∅ then ϕ is the formula true, else, according to our assumptions, we do not distinguish two formulas which can be made equal using the following transformation of the sub-formulas: ϕ ∧ ϕ =⇒ ϕ, ϕ ∧ ψ =⇒ ψ ∧ ϕ, (ϕ ∧ ψ) ∧ φ =⇒ ϕ ∧ (ψ ∧ φ), ϕ ∧ true =⇒ ϕ, ϕ ∨ false =⇒ ϕ. Thus ϕ is the formula ¬true 2 Property 2.3.2.6 Every solved formula is equivalent in T to a wnfv Boolean combination of elements of A0 .

Proof. Let ϕ be a solved formula. According to Definition 2.3.2.4, the formula ϕ is of the form ¬(∃¯ x0 α0 ∧

^

¬(∃¯ yi0 βi0 )),

i∈I

with ∃¯ x0 α0 ∈ A0 and ∃¯ yi0 βi0 ∈ A0 for all i ∈ I. Since ∃¯ x0 α0 ∈ A0 then according to Definition 0 0 2.2.1.1 T |= ∃?¯ x α and thus according to Corollary 2.1.1.4, ϕ is equivalent in T to the following wnfv formula ^ ¬(∃¯ x0 α0 ∧ (∃¯ yi0 βi0 ))). ¬((∃¯ x0 α0 ) ∧ i∈I

According to the definition of working formulas all the quantified variables of ϕ have distinct names and different from the names of the free variables, thus the preceding formula is equivalent in T to the wnfv formula ^ ¬(∃¯ x0 y¯i0 α0 ∧ βi0 )). ¬((∃¯ x0 α0 ) ∧ i∈I

Since ∃¯ x0 α0 ∈ A0 and ∃¯ yi0 βi0 ∈ A0 for all i ∈ I, then α0 ∈ A and βi0 ∈ A. Since A is T -closed then it closed for the conjunction and thus α0 ∧ βi0 ∈ A for all i ∈ I. According to Property 2.2.1.2 the preceding formula is equivalent in T to a wnfv formula of the form ¬((∃¯ x0 α0 ) ∧

^

¬(∃¯ zi0 δi0 )),

i∈I

with ∃¯ x0 α0 ∈ A0 and ∃¯ zi0 δi0 ∈ A0 for all i ∈ I. Which is finally equivalent in T to (¬(∃¯ x0 α0 )) ∨

_ i∈I

2 28

(∃¯ zi0 δi0 ).

2.3. A decision procedure in infinite-decomposable theories

2.3.3

The rewriting rules

We present now the rewriting rules which transform a working formula ϕ of any depth d into a wnfv conjunction φ of solved formulas which is equivalent to ϕ in T . To apply the rule p1 =⇒ p2 to the working formula p means to replace in p, a sub-formula p1 by the formula p2 , by considering that the connector ∧ is associative and commutative. "

(1)

¬

(2)

¬

(3)

h

∃¯ x false ∧ ϕ

"

∃¯ x α∧

¬

V

¬

 ¬ 

i∈I

i

i∈I

¬

=⇒

true

=⇒

¬

#

=⇒

∃¯ y0 β 0∧ zi0 δi0 ) i∈I ¬(∃¯

∃¯ x0 x ¯00 α0 ∧ α00 ∧ V

"

¬(∃¯ yi0 βi0 )

V

true

"

¬(∃¯ yi βi )

∃¯ x α ∧ ϕ∧ "

=⇒

#

∃¯ x α∧ V



(5)

#

¬(∃¯ y true)

"

(4)

∃¯ x α ∧ ϕ∧

¬

i∈I

¬(∃¯ x000 y¯i α000 ∧ βi )∗

∃¯ x0 α0 ∧ V

i∈I 0

#

#

¬(∃¯ yi0 βi0 )

 " #   =⇒ 

¬(∃¯ x α ∧ ϕ ∧ ¬(∃¯ y 0 β 0 ))∧ V

i∈I

#

¬(∃¯ xy¯0 z¯i0 α ∧ β 0 ∧ δi0 ∧ ϕ)∗

with α ∈ A, ϕ a conjunction of working formulas and I a finite (possibly empty) set. In the rule (3), the formula ∃¯ x α is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ 000 000 0 0 0 00 00 00 000 000 000 000 000 (∃¯ x α )) with ∃¯ x α ∈ A , ∃¯ x α ∈ A , ∃¯ x α ∈ A and ∃¯ x α different from ∃ε true. All 000 000 ∗ the βi ’s belong to A. The formula (∃¯ x y¯i α ∧ βi ) is the formula (∃¯ x000 y¯i α000 ∧ βi ) in which we 000 have renamed the variables of x ¯ by distinct names and different from the names of the free variables. In the rule (4), the formula ∃¯ x α is not an element of A0 and is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃ε true)) with ∃¯ x0 α0 ∈ A0 and ∃¯ x00 α00 ∈ A00 . 0 0 0 0 0 0 Each formula ∃¯ yi βi is an element of A . I is the set of the i ∈ I such that ∃¯ yi βi does not have free occurrences of any variables of x ¯00 . In the rule (5), I 6= ∅, ∃¯ y 0 β 0 ∈ A0 and ∃¯ zi0 δi0 ∈ A0 for all 0 0 0 0 ∗ 0 0 0 0 i ∈ I. The formula (∃¯ xy¯ z¯i α ∧ β ∧ δi ∧ ϕ) is the formula (∃¯ xy¯ z¯i α ∧ β ∧ δi ∧ ϕ) in which we have renamed the variables of x ¯ and y¯0 by distinct names and different from the names of the free variables. Property 2.3.3.1 Every repeated application of the preceding rewriting rules on any working formula ϕ, terminates and produces a wnfv conjunction φ of solved formulas which is equivalent to ϕ in T .

Proof, first part: The application of the rewriting rules terminates. Let us consider the 3-tuples (n1 , n2 , n3 ) where the ni ’s are the following positive integers: • n1 = α(p), where the function α is defined as follows: – α(true) = 0, 29

Chapter 2. Infinite-decomposable theory – α(¬(∃¯ x a ∧ ϕ)) = 2α(ϕ) , V

– α(

i∈I

P

ϕi ) =

i∈I

α(ϕi ),

with a ∈ A, ϕ a conjunction of working formulas and the ϕi ’s working formulas. Note that if α(p2 ) < α(p1 ) then α(p[p2 ]) < α(p) where p[p2 ] is the formula obtained from p when we replace the occurrence of the formula p1 in p by p2 . This function has been introduced in [41] and [7] to show the non-elementary complexity of every algorithm solving propositions in the theory of finite or infinite trees. It has also the property to decrease if the depth of the working formula decreases after application of distribution as it is done in our rule (5).

• n2 = β(p), where the function β is defined as follows: – β(true) = 0, (

– β(¬(∃¯ xa ∧

V

i∈I

ϕi )) =

41+

P i∈I

β(ϕi )

if ∃¯ x000 α000 6= ∃εtrue,

)

1 + i∈I β(ϕi ) if ∃¯ x000 α000 = ∃εtrue with the ϕi ’s working formulas and T |= (∃¯ xα) ↔ (∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ))). P

We show that: β(¬(∃¯ xα ∧

^

¬(∃¯ yi λi ))) > β(¬(∃¯ zδ ∧

i∈I

^

¬(∃wi γi )))

i∈I

where the formula ∃¯ x α is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 )) with ∃¯ x000 α000 6= ∃ε true, the formula ∃¯ z δ is equivalent in T to a decomposed formula of the form ∃¯ z 0 δ 0 ∧ (∃¯ z 00 δ 00 ∧ (∃ε true)) and all the λi and γi belong to A and have no particular conditions. • n3 is the number of the sub-formulas of the form ¬(∃¯ xα ∧ ϕ) with ∃¯ xα 6∈ A0 and ϕ a conjunction of working formulas. For each rule, there exists a row i such that the application of this rule decreases or does not change the values of the nj ’s, with 1 ≤ j < i, and decreases the value of ni . The row i is equal to: 1 for the rules (1), (2) and (5), 2 for the rule (3) and 3 for the rule (4). To each sequence of formulas obtained by a finite application of the preceding rewriting rules, we can associate a series of 3-tuples (n1 , n2 , n3 ) which is strictly decreasing in the lexicographic order. Since the ni ’s are positive integers, they cannot be negative, thus, this series of 3-tuples is a finite series and the application of the rewriting rules terminates. Proof, second part: Let us show now that for each rule of the form p =⇒ p0 we have T |= p ↔ p0 and the formula p0 remains a conjunction of working formulas. It is clear that the rules (1) and (2) are correct. Correctness of the rule (3): "

¬ 30

∃¯ x α∧ V

i∈I

¬(∃¯ yi βi )

#

"

=⇒ ¬

∃¯ x0 x ¯00 α0 ∧ α00 ∧ V

i∈I

¬(∃¯ x000 y¯i α000 ∧ βi )

#

2.3. A decision procedure in infinite-decomposable theories where the formula ∃¯ x α is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 )) with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 , ∃¯ x000 α000 ∈ A000 and ∃¯ x000 α000 different from ∃ε true. Let us show the correctness of this rule. According to the conditions of application of this rule, the formula ∃¯ x α is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 )) with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 , ∃¯ x000 α000 ∈ A000 and ∃¯ x000 α000 different from ∃ε true. Thus, the left formula of this rewriting rule is equivalent in T to the formula ¬(∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧

^

¬(∃¯ yi βi )))).

i∈I

Since ∃¯ x000 α000 ∈ A000 , then according to the fourth point of Definition 2.2.1.1 we have T |= ∃!¯ x000 α000 , thus using Corollary 2.1.1.7 the preceding formula is equivalent in T to ¬(∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ x000 α000 ∧ (∃¯ yi βi ))))

i∈I

According to the definition of the working formula the quantified variables have distinct names and different from the names of the free variables, thus, we can lift the quantifications and then the preceding formula is equivalent in T to ¬(∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ x000 y¯i α000 ∧ βi )))

i∈I

i.e. to ¬(∃¯ x0 x ¯00 α0 ∧ α00 ∧

^

¬(∃¯ x000 y¯i α000 ∧ βi )∗ ),

i∈I

(∃¯ x000 y¯i α000

)∗

where the formula ∧ βi is the formula (∃¯ x000 y¯i α000 ∧ βi ) in which we have renamed 000 the variables of x ¯ by distinct names and different from the names of the free variables. Thus, the rewriting rule (3) is correct in T . Correctness of the rule (4): "

¬

∃¯ x α∧ V

i∈I

¬(∃¯ yi0 βi0 )

#

"

=⇒ ¬

∃¯ x0 α0 ∧ V

i∈I 0

#

¬(∃¯ yi0 βi0 )

where the formula ∃¯ x α is not an element of A0 and is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃ε true)) with ∃¯ x0 α0 ∈ A0 and ∃¯ x00 α00 ∈ A00 . Each formula ∃¯ yi0 βi0 0 0 0 0 is an element of A . I is the set of the i ∈ I such that ∃¯ yi βi does not have free occurrences of 00 any variables of x ¯ . Let us show the correctness of this rule. According to the conditions of application of this rule, the formula ∃¯ x α is equivalent in T to a decomposed formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃ε true)) with ∃¯ x0 α0 ∈ A0 and ∃¯ x00 α00 ∈ A00 . Moreover, each formula ∃¯ yi0 βi0 belongs to A0 . Thus, the left formula of this rewriting rule is equivalent in T to the formula ¬(∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ yi0 βi0 )))

i∈I

Let us denote by I1 , the set of the i ∈ I such that x00n does not have free occurrences in the formula ∃¯ yi0 βi0 , thus, the preceding formula is equivalent in T to ¬(∃¯ x0 α0 ∧ (∃x001 ...∃x00n−1

" V

#

( i∈I1 ¬(∃¯ y 0 β 0 ))∧ Vi i )). 00 00 (∃xn α ∧ i∈I−I1 ¬(∃¯ yi0 βi0 ))

(2.24) 31

Chapter 2. Infinite-decomposable theory Since ∃¯ x00 α00 ∈ A00 and ∃¯ yi0 βi0 ∈ A0 for every i ∈ I − I1 , then according to Property 2.1.2.2 and the conditions 2 and 3 of Definition 2.2.1.1, the formula (2.24) is equivalent in T to ¬(∃¯ x0 α0 ∧ (∃x001 ...∃x00n−1 (true ∧

V

i∈I1

¬(∃¯ yi0 βi0 )))).

(2.25)

By repeating the three preceding steps (n − 1) times, by denoting by Ik the set of the i ∈ Ik−1 such that x00(n−k+1) does not have free occurrences in ∃¯ yi0 βi0 , and by using (n − 1) times Property 2.1.2.3, the preceding formula is equivalent in T to ¬(∃¯ x0 α0 ∧

V

i∈In

¬(∃¯ yi0 βi0 )),

Thus, the rule (4) is correct in T . Correctness of the rule (5):   ¬ 

∃¯ x α ∧ ϕ∧ "

¬

 "

∃¯ y0 β 0∧ V

#   =⇒ 

zi0 δi0 ) i∈I ¬(∃¯

¬(∃¯ x α ∧ ϕ ∧ ¬(∃¯ y 0 β 0 ))∧ V

i∈I

#

¬(∃¯ xy¯0 z¯i0 α ∧ β 0 ∧ δi0 ∧ ϕ)∗

where I 6= ∅ and the formulas ∃¯ y 0 β 0 and ∃¯ zi0 δi0 are elements of A0 for all i ∈ I. Let us show the correctness of this rule. Since ∃¯ y 0 β 0 ∈ A0 then according to the second point 0 0 of Definition 2.2.1.1 we have T |= ∃?¯ y β , thus, using Corollary 2.1.1.4 the preceding formula is equivalent to   ∃¯ x α ∧ ϕ∧ i  ¬ h V y 0 β 0 ) ∧ i∈I ¬(∃¯ y 0 β 0 ∧ (∃¯ zi0 δi0 )) ¬ (∃¯ According to the definition of the working formula the quantified variables have distinct names and different from the names of the free variables, thus we can lift the quantifications and then the preceding formula is equivalent in T to 

¬ thus to





∃¯ x α ∧ ϕ∧ ¬

h

(∃¯ y0 β 0) ∧

V

i∈I

¬(∃¯ y 0 z¯i0 β 0 ∧ δi0 )



∃¯ x α ∧ ϕ∧

¬ h

(¬(∃¯ y 0 β 0 )) ∨

i 

W

y 0 z¯i0 β 0 i∈I (∃¯

∧ δi0 )

i 

After having distributed the ∧ on the ∨ and lifted the quantification ∃¯ y 0 z¯i0 we get "

¬

(∃¯ x α ∧ ϕ ∧ ¬(∃¯ y 0 β 0 ))∨ W

xy¯0 z¯i0 α i∈I (∃¯

#

∧ ϕ ∧ β 0 ∧ δi0 )

which is equivalent in T to "

¬(∃¯ x α ∧ ϕ ∧ ¬(∃¯ y 0 β 0 ))∧ V

i∈I

¬(∃¯ xy¯0 z¯i0 α ∧ ϕ ∧ β 0 ∧ δi0 )

#

(2.26)

In order to satisfy the definition of the working formulas we must rename the variables of x ¯ and y¯0 by distinct names and different from the names of the free variables. Let us denote by 32

2.3. A decision procedure in infinite-decomposable theories (∃¯ xy¯0 z¯i0 α ∧ ϕ ∧ β 0 ∧ δi0 )∗ the formula (∃¯ xy¯0 z¯i0 α ∧ ϕ ∧ β 0 ∧ δi0 ) in which we have renamed the variables of x ¯ and y¯0 . Thus, the formula (2.26) is equivalent in T to "

¬(∃¯ x α ∧ ϕ ∧ ¬(∃¯ y 0 β 0 ))∧ V

i∈I

#

¬(∃¯ xy¯0 z¯i0 α ∧ ϕ ∧ β 0 ∧ δi0 )∗

Thus, the rule (5) is correct in T . It is very important to note that all the rewriting rules preserve the equivalence of the formulas without adding new free variables. Proof, third part: Every finite application of the rewriting rules on a working formula produces a wnfv conjunction of solved formulas. V Recall that we write i∈I ϕi , and call conjunction each formula of the form ϕi1 ∧ ϕi2 ∧ ... ∧ V ϕin ∧ true. In particular, for I = ∅, the conjunction i∈I ϕi is reduced to true. Moreover, we do not distinguish two formulas which can be made equal using the following transformation of the sub-formulas: ϕ ∧ ϕ =⇒ ϕ, ϕ ∧ ψ =⇒ ψ ∧ ϕ, (ϕ ∧ ψ) ∧ φ =⇒ ϕ ∧ (ψ ∧ φ), ϕ ∧ true =⇒ ϕ, ϕ ∨ false =⇒ ϕ. Let us show first that every substitution of a sub-working formula of a conjunction of working formulas by a conjunction of working formulas produces a conjunction of working formulas. Let V i∈I ϕi be a conjunction of working formulas. Let ϕk with k ∈ I an element of this conjunction of depth dk . Two cases arise: V

1. Either we replace ϕk by a conjunction of working formulas. Thus, let j∈Jk φj be a conjunction of working formulas which is equivalent to ϕk in T . The conjunction of working V formulas i∈I ϕi is equivalent in T to (

^

ϕi ) ∧ (

^

φj )

j∈Jk

i∈I−{k}

which is clearly a conjunction of working formulas. 2. Or, we replace a strict sub-working formula of ϕk by a conjunction of working formulas. Thus, let φ be a sub-working formula of ϕk of depth dφ < dk (thus φ is different from ϕk ). Thus, ϕk has a sub-working formula10 of the form ¬(∃¯ xα ∧ (

^

ψl ) ∧ (φ)),

l∈L

V

where L is a finite (possibly empty) set and all the ψl are working formulas. Let j∈J φj be a conjunction of working formulas which is equivalent to φ in T . Thus the preceding sub-working formula of ϕk is equivalent in T to ¬(∃¯ xα ∧ (

^

l∈L

ψl ) ∧ (

^

φj )),

j∈J

which is clearly a sub-working formula and thus ϕk is equivalent to a working formula and V thus i∈I ϕi is equivalent to a conjunction of working formulas. 10

By considering that the set of the sub-formulas of any formula ϕ contains also the whole formula ϕ.

33

Chapter 2. Infinite-decomposable theory From 1 and 2 we deduce that (i) every substitution of a sub-working formula of a conjunction of working formulas by a conjunction of working formulas produces a conjunction of working formulas. Since each rule transforms a working formula into a conjunction of working formulas, then according to (i) every finite application of the rewriting rules on a working formula produces a conjunction of working formulas. Let us show now that each of these final working formulas is solved. Let ϕ be a working formula. Let φ be the conjunction of working formulas obtained after finite application of the rules on ϕ. Suppose that the rules can not be applied anymore and one of the working formula of φ is not solved. Let ψ be this formula, two cases arise: Case 1: ψ is a working formula of depth greater than 2. Thus, ψ has a sub-formula of the form   ∃¯ x α ∧ ψ1 ∧ i  ¬ h V y β ∧ i∈I ¬(∃¯ zi δ i ) ¬ ∃¯ where ψ1 is a conjunction of working formulas, I is a nonempty set and α, β and δi are elements of A for all i ∈ I. Let (∃¯ y 0 β 0 ∧ (∃¯ x00 β 00 ∧ (∃¯ y 000 β 000 ))) be the decomposed formula in T of ∃¯ y β and 0 0 00 00 000 000 let (∃¯ zi δi ∧ (∃¯ zi δi ∧ (∃¯ zi δi ))) be the decomposed formula in T of ∃¯ zi δi . If ∃¯ y 000 β 000 is not the formula ∃εtrue then the rule (3) can still be applied which contradicts our supposition. Thus, suppose that ∃¯ y 000 β 000 = ∃εtrue (2.27) If there exists k ∈ I such that ∃¯ zk000 δk000 is not the formula ∃εtrue then the rule (3) can be still applied (with I = ∅) which contradicts our supposition. Thus, suppose that ∃¯ zi000 δi000 = ∃εtrue

(2.28)

for all i ∈ I. If there exists k ∈ I such that ∃¯ zk δk is not an element of A0 then since we have (2.28), the rule (4) can still be applied (with I = ∅) which contradicts our supposition. Thus, suppose that ∃¯ zi δ i ∈ A0 (2.29) for all i ∈ I. If ∃¯ y β is not an element of A0 then since we have (2.27) and (2.29), the rule (4) can still be applied which contradicts our supposition. Thus, suppose that ∃¯ y β ∈ A0

(2.30)

Since we have (2.29) and (2.30) then the rule (5) can still be applied which contradicts all our suppositions. Case 2: ψ is a working formula of the form ¬(∃¯ xα ∧

^

¬(∃¯ yi βi ))

i∈I

where at least one of the following conditions holds: 1. α is the formula false, 2. there exists k ∈ I such that βk is the formula true or false, 3. there exists k ∈ I such that ∃¯ yk βk 6∈ A0 , 34

2.4. Application to the theory T of finite or infinite trees 4. ∃¯ xα 6∈ A0 . If the condition (1) holds then the rule (2) can still be applied which contradicts our suppositions. If the condition (2) holds then the rules (1) and (2) can still be applied which contradicts our suppositions. If the condition (3) holds then the rule (3) or (4) (with I = ∅) can still be applied which contradicts our suppositions. If the condition (4) holds then according to the preceding point ∃¯ yi βi ∈ A0 for all i ∈ I and thus the rule (3) or (4) can still be applied which contradicts our suppositions. From Case 1 and Case 2, our suppositions are always false thus ψ is a solved formula and thus φ is a conjunction of solved formulas.

2.3.4

The decision procedure

Having any formula ψ, the resolution of ψ proceeds as follows: 1. Transform the formula ψ into a normalized formula and then into a working formula ϕ which is wnfv and equivalent to ψ in T . 2. Apply the preceding rewriting rules on ϕ as many time as possible. At the end we obtain a conjunction φ of solved formulas. According to Property 2.3.3.1, the application of the rewriting rules on a formula ψ without free variables produces a conjunction φ of solved formulas which is equivalent to ψ in T and does not contain free variables. According to Property 2.3.2.5, φ is either the formula true or ¬true, thus either T |= ψ or T |= ¬ψ and thus T is a complete theory. Corollary 2.3.4.1 If T is infinite-decomposable then every formula is equivalent in T either to true or to false or to a Boolean combination of elements of A0 which has at least one free variable.

2.4 2.4.1

Application to the theory T of finite or infinite trees The axioms of T

The theory T of finite or infinite trees built on an infinite set F of distinct function symbols has as axioms the infinite set of propositions of one of the three following forms: ∀¯ x∀¯ y ∀¯ x∀¯ y ∀¯ x∃!¯ z

¬f x ¯ = g y¯ V fx ¯ = f y¯ → i xi = yi V xz¯] i zi = ti [¯

[1] [2] [3]

where f and g are distinct function symbols taken from F , x ¯ is a vector of possibly non-distinct variables xi , y¯ is a vector of possibly non-distinct variables yi , z¯ is a vector of distinct variables zi and ti [¯ xz¯] is a term which begins with an element of F followed by variables taken from x ¯ or z¯. Note that this theory does not admit full elimination of quantifiers. In fact, in the formula ∃x y = f (x) we can not remove or eliminate the quantifier ∃x.

2.4.2

Properties of T

Suppose that the variables of V are ordered by a strict linear dense order relation without endpoints denoted by . 35

Chapter 2. Infinite-decomposable theory Definition 2.4.2.1 A conjunction α of flat equations is called ()-solved if all its left-hand sides are distinct and α does not contain equations of the form x = x or y = x, where x and y are variables such that x  y. Property 2.4.2.2 Every conjunction α of flat formulas is equivalent in T either to false or to a ()-solved conjunction of flat equations.

Proof. To prove this property we introduce the following rewriting rules: (1)

false ∧ α

=⇒

false,

(2)

x = f y1 ...ym ∧ x = gz1 ...zn

=⇒

false,

(3)

x = f y1 ...yn ∧ x = f z1 ...zn

=⇒

x = f y1 ...yn ∧

(4)

x=x

=⇒

true

(5)

y=x

=⇒

x=y

(6)

x = y ∧ x = f z1 ...zn

=⇒

x = y ∧ y = f z1 ...zn

(7)

x=y∧x=z

=⇒

x=y∧y =z

V

i∈{1,...,n} yi

= zi ,

with α any formula and f and g two distinct function symbols taken from F . The rules (5), (6) and (7) are applied only if x  y. This condition prevents infinite loops. Let us prove now that every repeated application of the preceding rewriting rules on any conjunction α of flat formulas, terminates and producing either the formula false or a ()-solved conjunction of flat equations which is equivalent to α in T . Proof, first part: The application of the rewriting rules terminates. Since the variables which occur in our formulas are ordered by the strict linear order relation without endpoints “  ”, we can number them by positive integers such that x  y ↔ no(x) > no(y), where no(x) is the number associated to the variable x. Let us consider the 4-tuples (n1 , n2 , n3 , n4 ) where the ni ’s are the following positive integers: • n1 is the number of occurrences of sub-formulas of the form x = f y1 ...yn , with f ∈ F , • n2 is the number of occurrences of atomic formulas, • n3 is the sum of the no(x)’s for all occurrence of a variable x, • n4 is the number of occurrences of formulas of the form y = x, with x  y. For each rule, there exists a row i such that the application of this rule decreases or does not change the value of the nj ’s, with 1 ≤ j < i, and decreases the value of ni . The row i is equal to: 2 for the rule (1), 1 for the rules (2) and (3), 3 for the rules (4), (6) and (7), 4 for the rule (5). To each sequence of formulas obtained by a finite application of the preceding rewriting rules, we can associate a series of 4-tuples (n1 , n2 , n3 , n4 ) which is strictly decreasing in the lexicographic order. Since the ni ’s are positive integers, they cannot be negative, thus, this series of 4-tuples is a finite series and the application of the rewriting rules terminates. Proof, second part: The rules preserve equivalence in T . The rule (1) is evident in T . The rules (2) preserves the equivalence in T according to the axiom 1. The rule (3) preserves the 36

2.4. Application to the theory T of finite or infinite trees equivalence in T according to the axiom 2. The rules (4), (5), (6) and (7) are evident in T . Proof, third part: The application of the rewriting rules terminates either by false or by a ()solved conjunction of flat equations. Suppose that the application of the rewriting rules on a conjunction α of flat formulas terminates by a formula β and at least one of the following conditions holds: 1. β is not the formula false and has at least a sub-formula of the form false, 2. β has two equations with the same left-hand side, 3. β contains equations of the form x = x or y = x with x  y. If the condition 1 holds then the rule (1) can still be applied which contradicts our supposition. If the condition 2 holds then the rules (2), (3), (6) and (7) can still be applied which contradicts our supposition. If the condition 3 holds then the rules (4) and (5) can still be applied which contradicts our supposition. Thus, the formula β according to Definition 2.4.2.1 is either the formula false or a ()-solved conjunction of flat equations. 2 Let us introduce now the notion of reachable variable and reachable equation. Definition 2.4.2.3 The equations and reachable variables from the variable u in the formula ∃¯ x

n ^

vi = ti

i=1

are those which occur in at least one of its sub-formulas of the form m j=1 vkj = tkj , where vk1 is the variable u and vkj +1 occurs in the term tkj for all j ∈ {1, .., m}. The equations and reachable variables of this formula are those who are reachable from a variables which does not occur in x ¯. V

Example 2.4.2.4 In the formula ∃uvw z = f uv ∧ v = gvu ∧ w = f uv, the equations z = f uv and v = gvu and the variables u and v are reachable. On the other hand the equation w = f uv and the variable w are not reachable. According to the axioms [1] and [2] of T we have the following property Property 2.4.2.5 Let α be a conjunction of flat equations. If all the variables of x ¯ are reachable in ∃¯ x α then T |= ∃?¯ x α. According to the axiom 3 we have: Property 2.4.2.6 Let α be a ()-solved conjunction of flat equations and let x ¯ be the vector of its left-hand sides. We have T |= ∃!¯ x α.

2.4.3

T is infinite-decomposable

Property 2.4.3.1 T is a decomposable theory. Let us show that T satisfies the conditions of Definition 2.2.1.1. 37

Chapter 2. Infinite-decomposable theory Choice of the sets Ψ(u), A, A0 , A00 and A000 Let F0 be the set of the 0-ary function symbols of F . The sets Ψ(u), A, A0 , A00 and A000 are chosen as follows: • Ψ(u) is the set {f aux} if F − F0 = ∅, else it contains formulas of the form ∃¯ y u = f y¯ with f ∈ F − F0 , • A is the set F L, • A0 is the set of the formulas of the form ∃¯ x0 α0 such that – α0 is either the formula false or a ()-solved conjunction of flat equations where the order  is such that all the variables of x ¯0 are greater than the free variables of ∃¯ x0 α0 , – all the variables of x ¯0 and all the equations of α0 are reachable in ∃¯ x0 α0 , • A00 is the set of the formulas of the form ∃¯ x00 true, • A000 is the set of the formulas of the form ∃¯ x000 α000 such that α000 is a ()-solved conjunction of flat equations and x ¯000 is the vector of the left-hand sides of the equations of α000 . It is clear that F L is T -closed and A0 , A00 and A000 contain formulas of the form ∃¯ x α with α ∈ F L. Let us show now that T satisfies the five condition of Definition 2.2.1.1 T satisfies the first condition Let us show that every formula of the form ∃¯ x α ∧ ψ, with α ∈ F L and ψ any formula, is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧ ψ)),

(2.31)

with ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 and ∃¯ x000 α000 ∈ A000 . Let us choose the order  such that all the variables of x ¯ are greater than the free variables of ∃¯ xα. According to Property 2.4.2.2 two cases arise: Either α is equivalent to false in T . Thus, x ¯0 = x ¯00 = x ¯000 = ε, α0 = false and α00 = α000 = true. Or, α is equivalent to a ()-solved conjunction β of flat equations. Let X be the set of the variables of the vector x ¯. Let Yrea be the set of the reachable variables of ∃¯ xβ. Let Lhs be the set of the variables which occur in a left-hand side of an equation of β. We have: − x ¯0 contains the variables of X ∩ Yrea . − x ¯00 contains the variables of (X − Yrea ) − Lhs. − x ¯000 contains the variables of (X − Yrea ) ∩ Lhs. − α0 is the conjunction of the reachable equations of ∃¯ xβ. − α00 is the formula true. − α000 is the conjunction of the unreachable equations of ∃¯ xβ. According to our construction it is clear that ∃¯ x0 α0 ∈ A0 , ∃¯ x00 α00 ∈ A00 and ∃¯ x000 α ∈ A000 . Let us show that (2.31) and ∃¯ xα ∧ ψ are equivalent in T . Let X 0 , X 00 and X 000 be the sets of the 0 variables of the vectors x ¯, x ¯00 and x ¯000 . If α is equivalent to false in T then the equivalence of the decomposition is evident. Else β is a conjunction of flat equations and thus according to our construction we have: X = X 0 ∪ X 00 ∪ X 000 , X 0 ∩ X 00 = ∅, X 0 ∩ X 000 = ∅, X 00 ∩ X 000 = ∅, for all 000 000 0 00 x00i ∈ X 00 we have x00i 6∈ var(α0 ) and for all x000 i ∈ X we have xi 6∈ var(α ∧ α ). Moreover each 38

2.4. Application to the theory T of finite or infinite trees equation of β occurs in α0 ∧ α00 ∧ α000 and each equation in α0 ∧ α00 ∧ α000 occurs in β and thus T |= β ↔ (α0 ∧ α00 ∧ α000 ). We have shown that the vectorial quantifications are coherent and the equivalence T |= β ↔ α0 ∧ α00 ∧ α000 holds. According to Property 2.4.2.2, we have T |= α ↔ β and thus, the decomposition keeps the equivalence in T . Example 2.4.3.2 Let us decompose the following formula ϕ ∃xyv z = f xy ∧ z = f xw ∧ v = f z. First, since w and z are free in ϕ then the order  will be chosen as follows: x  y  v  w  z. Note that the quantified variables are greater than the free variables. Then, using the rewriting rules of Property 2.4.2.2 we transform the conjunction of equations into a ()-solved formula. Thus, the formula ϕ is equivalent in T to the following formula ψ ∃xyv z = f xy ∧ y = w ∧ v = f z. Since the variables x, y, w and the equations z = f xy, y = w are reachable in ψ, then ψ is equivalent in T to the following decomposed formula ∃xy z = f xy ∧ y = w ∧ (∃ε true ∧ (∃v v = f z)). It is clear that (∃xy z = f xy ∧ y = w) ∈ A0 , (∃ε true) ∈ A00 and (∃v v = f z) ∈ A000 . T satisfies the second condition Let us show that if ∃¯ x0 α0 ∈ A0 then T |= ∃?¯ x0 α0 . Since ∃¯ x0 α0 ∈ A0 and according to the choice of the set A0 , either α0 is the formula false and thus we have immediately T |= ∃?¯ x0 α0 or α0 is 0 a ()-solved conjunction of flat equations and the variables of x ¯ are reachable in ∃¯ x0 α0 . Thus, 0 0 using Property 2.4.2.5 we get T |= ∃?¯ xα. Let us show now that if y is a free variable of ∃¯ x0 α0 then T |= ∃?y¯ x0 α0 or there exists 0 0 ψ(u) ∈ Ψ(u) such that T |= ∀y (∃¯ x α ) → ψ(y). Let y be a free variable of ∃¯ x0 α0 . It is clear that α0 can not be in this case the formula false. Thus, four cases arise: If y occurs in a sub-formula of α0 of the form y = t(¯ x0 , z¯0 , y), where z¯0 is the set of the free 0 0 variables of ∃¯ x α which are different from y and where t(¯ x0 , z¯0 , y) is a term which begins by an element of F − F0 followed by variables taken from x ¯0 or z¯0 or {y}, then the formula ∃¯ x0 α0 implies 0 0 0 0 0 0 in T the formula ∃¯ x y = t(¯ x , z¯ , y), which implies in T the formula ∃¯ x z¯ w y = t(¯ x , z¯0 , w), where 0 0 0 0 y = t(¯ x , z¯ , w) is the formula y = t(¯ x , z¯ , y) in which we have replaced every free occurrence of 0 0 y in the term t(¯ x , z¯ , y) by the variable w. According to the choice of the set Ψ(u), the formula ∃¯ x0 z¯0 w u = t(¯ x0 , z¯0 , w) belongs to Ψ(u). If y occurs in a sub-formula of α0 of the form y = f0 with f0 ∈ F0 then T |= ∃!y y = f0 according to the third axiom of T . Thus (i) T |= ∃?y α0 . On the other hand, since α0 is ()solved, y has no occurrences in an other left-hand side of an equation of α0 , thus, since the variables of x ¯ are reachable in ∃¯ x0 α0 (according to the choice of the set A0 ), all the variables of 0 0 0 x ¯ keep reachable in ∃¯ x y α and thus using (i) and Property 2.4.2.5 we get T |= ∃?¯ x0 y α0 . If y occurs in a sub-formula of α0 of the form y = z then: 1. According to the choice of the set A0 , the order  is such that all the variables of x ¯0 are 0 0 greater than the free variables of ∃¯ xα. 39

Chapter 2. Infinite-decomposable theory 2. According to Definition 2.4.2.2 of the ()-solved formula, we have y  z. From (1) and (2), we deduce that z is a free variable in ∃¯ x0 α0 . Since α0 is ()-solved, y has no occurrences in an other left-hand side of an equation of α0 , thus, since the variables of x ¯ are reachable in ∃¯ x0 α0 (according to the choice of the set A0 ), all the variables of x ¯0 keep reachable in ∃¯ x0 y α0 . Moreover, for each value of z there exists at most a value for y. Thus, using Property 2.4.2.5 we get T |= ∃?¯ x0 y α0 . If y occurs only in the right-hand sides of the equations of α0 , then according to the choice of the set A0 , all the variables of x ¯0 and all the equations of α0 are reachable in ∃¯ x0 α0 . Thus, since 0 y does not occur in a left-hand side of an equation of α , the variable y and the variables of x ¯0 are reachable in ∃¯ x0 y α0 and thus using Property 2.4.2.5 we get T |= ∃?¯ x0 y α0 . In all the cases T satisfies the second condition of Definition 2.2.1.1. T satisfies the third condition First, we present a property which holds in any model M of T . This property results from the axiomatization of T (more exactly from the axioms 1 and 2) and the infinite set of function symbols F . Property 2.4.3.3 Let M be a model of T and let f be a function symbol taken from F − F0 . The set of the individuals i of M , such that M |= ∃x i = f x, is infinite. Let ∃¯ x00 α00 be a formula which belongs to A00 . According to the choice of A00 , this formula is Ψ(u) of the form ∃¯ x00 true. Let us show that, for every variable x00j of x ¯00 we have T |= ∃∞ xj true. Two cases arise: Either F − F0 = ∅ then Ψ(u) = {f aux} and F0 is infinite since the theory is defined on an infinite set of function symbols. According to Axiom of conflict of symbols, for every distinct constants f and g correspond two distinct individuals in every model of T . Thus, since F0 is infinite there exists an infinite set of individuals in every model of T and thus according to {false} Definition 2.1.2.1, we have: T |= ∃∞ xj true. Or, F − F0 6= ∅, thus Ψ(u) contains formulas of the form ∃¯ z u = f z¯ with f ∈ F − F0 . Let M be a model of T . Since the formula ∃x00j true does not have free variables, it is already instantiated, and thus according to Definition 2.1.2.1 it is enough to show that there exists an infinity of individuals i of M which satisfy the following condition: M |= ¬ψ1 (i) ∧ · · · ∧ ¬ψn (i),

(2.32)

with ψj (u) ∈ Ψ(u), i.e. of the form ∃¯ z u = f z¯ with f ∈ F − F0 . Two cases arise: • Either F −F0 is a finite set, then F0 is infinite because the theory is defined on an infinite set of function symbols. Thus, there exists an infinity of constants fk which are different from all the function symbols of all the ψj (u) and thus using the axiom of conflict of symbols there exists an infinity of distinct individuals i such that (2.32). • Or, F − F0 is infinite, then there exists a formula ψ(u)∗ ∈ Ψ(u) which is different from all the ψj (u) of (2.32), i.e. which has a function symbol which is different from the function symbols of all the ψ1 (u) · · · ψn (u). According to Property 2.4.3.3 there exists an infinity of individuals i such that M |= ψ(i)∗ . Since this ψ(u)∗ is different from all the ψj (u), then according to axiom of conflict of symbols there exists an infinite set of individuals i such that M |= ψ(i)∗ ∧ ¬ψ1 (i) ∧ · · · ∧ ¬ψn (i) and thus such that (2.32). 40

2.4. Application to the theory T of finite or infinite trees T satisfies the fourth condition Let us show that if ∃¯ x000 α000 ∈ A000 then T |= ∃!¯ x000 α000 . Let ∃¯ x000 α000 be an element of A000 . According to the choice of the set A000 and Property 2.4.2.6 we get immediately T |= ∃!¯ x000 α000 . T satisfies the fifth condition Let us show that if the formula ∃¯ x0 α0 belongs to A0 and has no free variables then this formula is either the formula ∃εtrue or ∃εfalse. Let ∃¯ x0 α0 be a formula, without free variables, which belongs to A0 . We have 1. According to the choice of the set A0 , all the variables and equations of ∃¯ x0 α0 are reachable 0 0 0 in ∃¯ x α and α is either the formula false or a ()-solved conjunction of flat equations. 2. Since the formula ∃¯ x0 α0 has no free variables and according to Definition 2.4.2.3 there exists in this case neither variables nor equations reachable in ∃¯ x0 α0 , Thus, from (1) and (2), x ¯0 is the empty vector, i.e. ε and α0 is either the formula true or false. We have shown that T satisfies the five conditions of Definition 2.2.1.1. Moreover, T. Dao has shown in [16] that this theory has as model the algebra of finite or infinite trees introduced by Maher in [33], then T is infinite-decomposable and thus complete. 2

2.4.4

Solving first-order propositions in T

Example 2.4.4.1 Let us solve the following formula ϕ1 in T : ∃x∀y ((∃zwv y = f z ∧ y = f x ∧ w = gzv) ∨ (x = f y ∧ x = f x)) Using Property 2.3.1.3 we first transform the preceding formula into the following normalized formula   ∃y true∧   ¬(∃ε true ∧ ¬(∃x true ∧ ¬  ¬(∃zwv y = f z ∧ y = f x ∧ w = gzv)∧ )) (2.33) ¬(∃ε x = f y ∧ x = f x) Since A = F L then the preceding normalized formula is a working formula. Let us decompose the sub-formula ∃zwv y = f z ∧ y = f x ∧ w = gzv. (2.34) According to Section 2.4.3, the order  is chosen such that z  w  v  y  x. Using the rewriting rules of Property 2.4.2.2, the sub-formula y = f z ∧ y = f x ∧ w = gzv is equivalent in T to the ()-solved formula y = f z ∧ z = x ∧ w = gzv, and thus according to Section 2.4.3, the decomposed formula of (2.34) is ∃z y = f z ∧ z = x ∧ (∃v true ∧ (∃w w = gzv)) Since (∃w w = gzv) 6= (∃ε true) we can apply the rule (3) with I = ∅, thus, the formula (2.33) is equivalent in T to 



∃y true∧   ¬(∃ε true ∧ ¬(∃x true ∧ ¬  ¬(∃zv y = f z ∧ z = x)∧ )) ¬(∃ε x = f y ∧ x = f x)

(2.35)

41

Chapter 2. Infinite-decomposable theory The sub-formula ∃zv y = f z ∧ z = x is not an element of A0 and is equivalent in T to the decomposed formula ∃z y = f z ∧ z = x ∧ (∃v true ∧ (∃ε true)), thus we can apply the rule (4) with I = ∅ and the formula (2.35) is equivalent in T to 



∃y true∧   ¬(∃ε true ∧ ¬(∃x true ∧ ¬  ¬(∃z y = f z ∧ z = x)∧ )) ¬(∃ε x = f y ∧ x = f x)

(2.36)

Let us decompose now the sub-formula ∃ε x = f y ∧ x = f x

(2.37)

Using the rewriting rules of Property 2.4.2.2, the sub-formula x = f y ∧ x = f x is equivalent in T to the ()-solved formula x = f y ∧ y = x and thus according to Section 2.4.3 the decomposed formula of (2.37) is ∃ε x = f y ∧ y = x ∧ (∃ε true ∧ (∃ε true)) Since (∃ε x = f y ∧ x = f x) 6∈ A0 , then we can apply the rule (4) with I = ∅ and thus the formula (2.36) is equivalent in T to 



∃ytrue∧   ¬(∃ε true ∧ ¬(∃x true ∧ ¬  ¬(∃z y = f z ∧ z = x)∧ )) ¬(∃ε x = f y ∧ y = x)

(2.38)

According to Section 2.4.3, the formula ∃ε vrai ∧ (∃y true ∧ (∃ε true)) is the decomposed formula of ∃y true. Since ∃y true 6∈ A0 , (∃z y = f z ∧ z = x) ∈ A0 and (∃ε x = f y ∧ y = x) ∈ A0 then we can apply the rule (4) and thus the formula (2.38) is equivalent in T to ¬(∃ε true ∧ ¬(∃ε true ∧ ¬(∃ε true))

(2.39)

Finally, we can apply the rule (1) thus the formula (2.39) is equivalent in T to ¬(∃ε true). Thus ϕ1 is false in T . Example 2.4.4.2 Let us solve the following formula ϕ2 in T : ∃x ∀y ((∃z y = f z ∧ z = x) ∨ (∃ε x = f y ∧ y = x) ∨ ¬(x = f y))

(2.40)

Using Property 2.3.1.3 we first transform the preceding formula into the following normalized formula 



∃y x = f y∧   ¬(∃ε true ∧ ¬(∃x true ∧ ¬  ¬(∃z y = f z ∧ z = x)∧ )) ¬(∃ε x = f y ∧ y = x)

(2.41)

Since A = F L then the preceding normalized formula is a working formula in T . Since (∃y x = f y) ∈ A0 , (∃z y = f z ∧ z = x) ∈ A0 and (∃ε x = f y ∧ y = x) ∈ A0 then we can apply the rule (5), thus the formula (2.41) is equivalent in T to    

¬

42

∃ε true∧ ¬(∃x true ∧ ¬(∃y x = f y))∧ ¬(∃x1 y1 z x1 = f y1 ∧ y1 = f z ∧ z = x1 )∧ ¬(∃x2 y2 x2 = f y2 ∧ x2 = f y2 ∧ y2 = x2 )

    

(2.42)

2.5. Discussion and partial conclusion According to Section 2.4.3, the formula ∃ε true ∧ (∃x true ∧ (∃ε true)) is the decomposed formula of ∃x true. Since (∃x true) 6∈ A0 and (∃y x = f y) ∈ A0 then we can apply the rule (4) and thus the formula (2.42) is equivalent in T to    

¬

∃ε true∧ ¬(∃ε true)∧ ¬(∃x1 y1 z x1 = f y1 ∧ y1 = f z ∧ z = x1 )∧ ¬(∃x2 y2 x2 = f y2 ∧ x2 = f y2 ∧ y2 = x2 )

    

(2.43)

Finally, we can apply the rule (1), thus the formula (2.43) is equivalent in T to true. Thus ϕ2 is true in T .

2.5

Discussion and partial conclusion

Our decision procedure which is ideal for deciding the validity of complex propositions can also be applied to first order formulas having free variables and produces in this case a conjunction φ of solved formulas easily transformable into a boolean combination of basic formulas. But in no cases, our algorithm can warrant that φ is neither true nor false if it contains at least one free variables. It can not also present the solutions of the free variables in a clear and explicit way and can not detect if a formula having at least one free variable is always true or false. This is why this algorithm is called decision procedure and not general algorithm solving first order constraints. In the other hand, we have shown the infinite-decomposability of fundamental theories such as: the equational theory, the theory of additive rational or real numbers, the theory of finite trees, the theory of infinite trees, the theory of finite or infinite trees and a combination of finite or infinite trees with additive rational or real numbers [26]. What about the decomposability of the theory of linear dense order ? If we take as model the rational numbers then for every instantiation of the free variables of the formula ∃x z < x ∧ x < y: either there exists an infinity values for x, or there exists no values for x ! In fact, if the variables z and y are instantiated respectively by 1 and 0, then there exists no instantiations for x such that 1 < x ∧ x < 0 ! This new behavior does not satisfy the infinite quantifier and thus the theory of linear dense order is not infinite-decomposable. We must find a new quantifier more expressive than the infinite quantifier ! This will be our goal in Chapter 3.

43

Chapter 2. Infinite-decomposable theory

44

Chapter 3

Zero-infinite-decomposable theory Contents Ψ(u)

Zero-infinite quantifier: ∃o ∞ . . . . . . . . . . . . . . . . . . . . . . . Zero-infinite-decomposable theory . . . . . . . . . . . . . . . . . . . . 3.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4 Fundamental example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 A decision procedure in zero-infinite-decomposable theories . . . . 3.3.1 Normalized Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 Working formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 The rewriting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.4 The decision procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Application to the construction of trees on an ordered set Tord . . . 3.4.1 Axiomatization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 The standard model of Tord . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.3 Block and solved block in Tord . . . . . . . . . . . . . . . . . . . . . . . 3.4.4 Tord is zero-infinite-decomposable . . . . . . . . . . . . . . . . . . . . . 3.4.5 Solving first order propositions in Tord . . . . . . . . . . . . . . . . . . . 3.5 Discussion and partial conclusion . . . . . . . . . . . . . . . . . . . . 3.1 3.2

46 47 47 48 51 53 57 57 57 60 67 67 67 69 69 72 76 79

We present in this chapter the class of the zero-infnite-decomposable theories which is an extension of the infinite-decomposable theories, and where the infinite quantifier has been replaced by a new quantifier called zero-infinite. We show the completeness of these theories using the sufficient condition of completeness of first order theories given in Chapter 1, and give some examples of fundamental zero-infinite-decomposable theories. We present also a property that links the infinite-decomposable theories to the zero-infinite-decomposable theories and show that the infinite theories Eq, Ra and T are also zero-infinite-decomposable. Then, we give a decision procedure in every zero-infinite-decomposable theory T , in the form of six rewriting rules which transform a formula ϕ, which can possibly contain free variables, into a wnfv conjunction φ of solved formulas, equivalent to ϕ in T and such that φ is, either the formula true, or the formula V i∈I ¬true, or a formula having at least one free variable and being easily transformable into a boolean combination of quantified conjunctions of atomic formulas. In particular, if ϕ has no 45

Chapter 3. Zero-infinite-decomposable theory free variables, then φ is, either the formula true, or the formula ¬true. The correctness of our algorithm is another proof of the completeness of the zero-infinite-decomposable theories. We end this chapter by an application to the construction of trees on an ordered set. This theory denoted by Tord , is a complete axiomatization of a tree construction on any set of individuals together with a linear dense order relation without endpoints. After having presented the axioms of Tord , we show its zero-infinite-decomposability and end by an example on solving propositions in Tord . Note that the results presented in this chapter have been published in [23], [24] and [25].

3.1

Zero-infinite quantifier: ∃oΨ(u) ∞

Let M be a model and T a theory. Let Ψ(u) be a set of formulas having at most one free variable u. Let ϕ and ϕj be M -formulas. Definition 3.1.0.3 We write M |= ∃Ψ(u) o ∞ x ϕ(x),

(3.1)

if for each instantiation ∃x ϕ0 (x) of ∃x ϕ(x) by individuals of M one of the following properties holds: • the set of the individuals i of M such that M |= ϕ0 (i), is infinite, • for all finite sub-set {ψ1 (u), .., ψn (u)} of elements of Ψ(u), the set of the individuals i of V M such that M |= ϕ0 (i) ∧ j∈{1,...,n} ¬ψj (i) is infinite. Ψ(u)

Ψ(u)

We write T |= ∃o ∞ x ϕ(x), if for every model M of T we have M |= ∃o ∞ x ϕ(x). This quantifier is more general than the infinite quantifier and does not restrict the model to be infinite. In the case where Ψ(u) = {false}, the form (3.1) means that if M |= ∃x ϕ(x) then M contains an infinity of individuals i such that M |= ϕ(i). Ψ(u)

Property 3.1.0.4 Let J be a finite possibly empty set. If T |= ∃o ∞ x ϕ(x) and if for each ϕj , one at least of the following properties holds: • T |= ∃?x ϕj , • there exists ψj (u) ∈ Ψ(u) such that T |= ∀x ϕj → ψj (x), then T |= (∃x ϕ(x) ∧

V

j∈J

¬ϕj ) ↔ (∃x ϕ(x)).

Proof. Let ∃x ϕ0 (x) be an instantiation of ∃x ϕ(x) by individuals of M . Let us show that if the conditions of this property hold, then M |= (∃x ϕ0 (x) ∧

V

j∈J

¬ϕj (x)) ↔ (∃x ϕ0 (x)).

(3.2)

Let J 0 be the set of the j ∈ J such that M |= ∃?x ϕj (x) and let m be its cardinality. Since for all j ∈ J 0 , M |= ∃?x ϕ0j (x), then it is enough that M contains at least m + 1 individuals, to warrant the existence of an individual i ∈ M such that M |=

^ j∈J 0

46

¬ϕ0j (i).

(3.3)

3.2. Zero-infinite-decomposable theory Ψ(u)

On the other hand, since T |= ∃o ∞ x ϕ(x) and according to Definition 3.1.0.3 of the zero-infinite quantifier, two cases arise: V (1) Either, M |= ¬(∃x ϕ0 (x)), thus M |= ¬(∃¯ x ϕ0 (x) ∧ j∈J ¬ϕj (x)) and thus the equivalence (3.2) holds in M . (2) Or, for every finite sub-set {ψ1 (u), ..., ψn (u)} of Ψ(u), the set of the individuals i of V M such that M |= ϕ0 (i) ∧ nj=1 ¬ψj (i) is infinite. Thus, since for all j ∈ J − J 0 we have M |= ∀x ϕj (x) → ψj (x), then there exists an infinite set ξ of individuals i of M such that V M |= ϕ0 (i) ∧ j∈J−J 0 ¬ϕj (i). Since ξ is infinite, then it contains at least m + 1 individuals and thus according to (3.3), there exists at least an individual i ∈ ξ such that M |= ϕ0 (i) ∧ V V ( j∈J−J 0 ¬ϕ0j (i)) ∧ ( k∈J 0 ¬ϕ0k (i)) and thus such that M |= ∃x ϕ0 (x) ∧

^

¬ϕ0j (x).

j∈J

Since M |= ∃x ϕ0 (x) ∧ M. 2

V

j∈J

¬ϕj (x), then M |= ∃x ϕ0 (x) and thus the equivalence (3.2) holds in Ψ(u)

Ψ(u)

Property 3.1.0.5 If T |= ∃∞ x ϕ(x) then T |= ∃o ∞ x ϕ(x). Let us recall in this section some properties of the vectorial quantifiers. These properties are proved in Chapter 2. We will handle them all long this chapter. Property 3.1.0.6 If T |= ∃?¯ y φ and if all the variables of y¯ has no free occurrences in ϕ then 



(∃¯ x ϕ ∧ ¬(∃¯ y φ))   ∨ T |= (∃¯ x ϕ ∧ ¬(∃¯ y φ ∧ ψ)) ↔  . (∃xy ϕ ∧ φ ∧ ¬ψ) Corollary 3.1.0.7 If T |= ∃?¯ x ϕ then T |= (∃¯ xϕ ∧

^

^

¬φi ) ↔ ((∃¯ xϕ) ∧

¬(∃¯ x ϕ ∧ φi )).

i∈I

i∈I

Corollary 3.1.0.8 If T |= ψ → (∃!¯ x ϕ) then T |= (ψ ∧ (∃¯ xϕ ∧

^ i∈I

3.2

¬φi )) ↔ (ψ ∧

^

¬(∃¯ x ϕ ∧ φi )).

i∈I

Zero-infinite-decomposable theory

3.2.1

Definition

Definition 3.2.1.1 A theory T having at least one model is called zero-infinite-decomposable, if there exists a set Ψ(u) of formulas, having at most one free variable u, a set A of formulas closed for the conjunction, a set A0 of formulas of the form ∃¯ xα with α ∈ A, and a sub-set A00 of A such that 1. every formula of the form ∃¯ x α ∧ ψ, with α ∈ A and ψ any formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧ ψ)), with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , α000 ∈ A and T |= ∀¯ x00 α00 → ∃!¯ x000 α000 , 47

Chapter 3. Zero-infinite-decomposable theory 2. if ∃¯ x0 α0 ∈ A0 , then T |= ∃?¯ x0 α0 and for every free variable y in ∃¯ x0 α0 , at least one of the following properties holds • T |= ∃?y¯ x0 α0 , • there exists ψ(u) ∈ Ψ(u) such that T |= ∀y (∃¯ x0 α0 ) → ψ(y), 3. if α00 ∈ A00 then • the formula ¬α00 is equivalent in T to a wnfv formula of the form i∈I αi with αi ∈ A, • for all x00 , the formula ∃x00 α00 is equivalent in T to a wnfv formula which belongs to A00 , W

Ψ(u)

• for every variable x00 , T |= ∃o ∞ x00 α00 , 4. every conjunction of flat formulas is equivalent in T to a wnfv disjunction of elements of A, 5. if the formula ∃¯ x0 α0 ∧ α00 with ∃¯ x0 α0 ∈ A0 and α00 ∈ A00 has no free variables, then x ¯ = ε, 0 00 and α and α belong to {true, false}. Note that the decomposition expressed in this definition is similar to the one defined in the infinite decomposable theories by replacing the infinite quantifier by the zero-infinite quantifier. The main difference between the two classes of theories resides in the set A00 whose properties have been increased.

3.2.2

Properties

Property 3.2.2.1 If T is zero-infinite-decomposable then every formula of the form ∃¯ xα, with α ∈ A, is equivalent in T , to a wnfv formula of the form ∃¯ x0 α0 ∧α00 , with ∃¯ x0 α0 ∈ A0 and α00 ∈ A00 . Proof. According to the first point of Definition 3.2.1.1, the formula ∃¯ xα is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 )), (3.4) with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , α000 ∈ A and T |= ∀¯ x00 α00 → ∃!¯ x000 α000 . Since T |= ∀¯ x00 α00 → ∃!¯ x000 α000 and according to Corollary 3.1.0.8 (with φ is the formula false), the formula (3.4) is equivalent in T to ∃¯ x0 α0 ∧ (∃¯ x00 α00 ), which, since α00 ∈ A00 and according to the second condition of the third point of Definition 3.2.1.1, is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ α100 , with ∃¯ x0 α0 ∈ A0 and α100 ∈ A00 . 2 Property 3.2.2.2 Let I a finite possibly empty set. If T is zero-infinite-decomposable then every formula of the form V ∃¯ xα ∧ i∈I ¬(∃¯ yi βi ), (3.5) with α ∈ A and βi ∈ A for all i ∈ I, is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ yj0 βj0 ∧ βj00 )),

j∈J

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , J a finite possibly empty set with Card(I) = Card(J) and for all j ∈ J we have ∃¯ yj0 βj0 ∈ A0 and βj00 ∈ A00 . 48

3.2. Zero-infinite-decomposable theory Proof. According to the third point of Definition 3.2.1.1 (with ψ = (3.5) is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (∃¯ x000 α000 ∧

V

j∈J

V

i∈I

¬(∃¯ yi βi )), the formula

¬(∃¯ yj βj ))),

(3.6)

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , α000 ∈ A, βj ∈ A for all j ∈ J, T |= ∀¯ x00 α00 → ∃!¯ x000 α000 and 00 00 000 000 Card(I) = Card(J). Since T |= ∀¯ x α → ∃!¯ x α and according to Corollary 3.1.0.8, the formula (3.6) is equivalent in T to the wnfv formula ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ x000 (α000 ∧ ∃¯ yj βj ))).

j∈J

By lifting the quantifications ∃¯ yj after having possibly renamed some variables which occur in the y¯j , the preceding formula is equivalent in T to ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ x000 y¯j α000 ∧ βj )),

j∈J

which, since A is closed for the conjunction, is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ yk βk )),

k∈K

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , βk ∈ A for all k ∈ K and Card(K) = Card(J) = Card(I). According to Property 3.2.2.1, the preceding formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

¬(∃¯ y`0 β`0 ∧ β`00 )),

^ `∈L

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , for all ` ∈ L we have ∃¯ y`0 β`0 ∈ A0 and β`00 ∈ A00 with Card(L) = Card(K) = Card(J) = Card(I). 2 Corollary 3.2.2.3 Let I be a finite possibly empty set. If T is zero-infinite-decomposable then every formula of the form ^ ¬(∃¯ yi βi ), (3.7) ∃¯ xα ∧ i∈I

with α ∈ A and βi ∈ A for all i ∈ I, is equivalent in T to a wnfv disjunction of formulas of the form ^ ¬(∃¯ yj0 βj0 )), ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ j∈J

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , J a finite possibly empty set and for all j ∈ J we have ∃¯ yj0 βj0 ∈ A0 . Proof. If I is empty then the corollary holds according to Property 3.2.2.2. Else, suppose that I = {1, 2, ..., n} and n 6= 0. According to Property 3.2.2.2, the formula (3.7) is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ yi0 βi0 ∧ βi00 )),

(3.8)

i∈I

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , I = {1, 2, ..., n}, and for all i ∈ I we have ∃¯ yi0 βi0 ∈ A0 and βi00 ∈ A00 . Thus, the formula (3.8) is equivalent in T to ∃¯ x0 α0 ∧ (∃¯ x00 (α00 ∧

^

¬(∃¯ yi0 βi0 ∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 ∧ βn00 )).

i∈I,i6=n

49

Chapter 3. Zero-infinite-decomposable theory Since ∃¯ yn0 βn0 ∈ A0 , then according to the second point of Definition 3.2.1.1 we have T |= ∃?¯ yn0 βn0 . V Thus, according to Corollary 3.1.0.6 (with ϕ = α00 ∧ i∈I,i6=n ¬(∃¯ yi0 βi0 ∧βi00 )), the preceding formula is equivalent in T to (∃¯ x0 α0 ∧ (∃¯ x00 (α00 ∧



V

yi0 βi0 i∈I,i6=n ¬(∃¯

∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 )))



∨ T |=  , V 0 0 00 00 0 0 00 0 00 (∃¯ x α ∧ (∃¯ x y¯n (α ∧ i∈I,i6=n ¬(∃¯ yi βi ∧ βi )) ∧ βn ∧ ¬βn )) 



which according to the first condition of the third point of Definition 3.2.1.1 is equivalent in T to   V (∃¯ x0 α0 ∧ (∃¯ x00 (α00 ∧ i∈I,i6=n ¬(∃¯ yi0 βi0 ∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 )))   ∨ T |=  , V W (∃¯ x0 α0 ∧ (∃¯ x00 y¯n (α00 ∧ i∈I,i6=n ¬(∃¯ yi0 βi0 ∧ βi00 )) ∧ βn0 ∧ ( j∈Jn βnj ))) with T |= (¬βn00 ) ↔ ( j∈Jn βnj ) and βnj ∈ A for all j ∈ Jn . After having distributed the ∧ on the ∨ and the ∃ on the ∨, the preceding formula is equivalent in T to W

(∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (



V

¬(∃¯ yi0 βi0 i∈I,i6 W=n

∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 )))



∨ j∈Jn T |=  , V 0 0 00 00 (∃¯ x α ∧ (∃¯ x y¯n α ∧ βn0 ∧ βnj ∧ i∈I,i6=n ¬(∃¯ yi0 βi0 ∧ βi00 ))) 



which by lifting the quantification ∃¯ x00 y¯n and by renaming possibly some variables which occur in x ¯00 y¯n is equivalent in T to (∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (



V

¬(∃¯ yi0 βi0 i∈I,i6 W=n

∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 )))



∨ j∈Jn T |=  V 0 00 0 00 0 yi0 βi0 ∧ βi00 )) (∃¯ x ∃¯ x y¯n α ∧ α ∧ βn ∧ βnj ∧ i∈I,i6=n ¬(∃¯ 

 ,

which according to Property 3.2.2.2 (because A is closed for the conjunction and A00 is a sub-set of A), is equivalent in T to a wnfv formula of the form (∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (



V

¬(∃¯ yi0 βi0 i∈I,i6 W=n

∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 )))

∨ j∈Jn T |=  V 0 δ 0 ∧ δ 00 )) (∃¯ x0j αj0 ∧ αj00 ∧ i∈I,i6=n ¬(∃¯ zij ij ij 

  ,

(3.9)

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , I = {1, 2, ..., n}, ∃¯ yn0 βn0 ∈ A0 , for all i ∈ I with i 6= n we have 0 0 0 00 00 0 δ 0 ∈ A0 and ∃¯ yi βi ∈ A and βi ∈ A and for all j ∈ Jn we have ∃¯ x0j αj0 ∈ A0 , αj00 ∈ A00 , ∃¯ zij ij 00 00 δij ∈ A . Thus, starting from the formula (3.8) which has car(I) = n sub-formulas of the form ¬(∃¯ yi0 βi0 ∧ βi00 ),

(3.10)

with ∃¯ yi0 βi0 ∈ A0 and βi00 ∈ A00 , we get a wnfv disjunction of formulas each one containing card(I) − 1 = n − 1 sub-formulas of the form (3.10). Thus, we have (1) By repeating another time the preceding steps on the first formula of (3.9) of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (

^

¬(∃¯ yi0 βi0 ∧ βi00 )) ∧ ¬(∃¯ yn0 βn0 )),

i∈I,i6=n

we get a wnfv formula equivalent in T of the form (∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (



V

¬(∃¯ yi0 βi0 i∈I,i6 W=n,i6=n−1

 ∨ j∈Jn−1 T |=  V 0 0 00 0 δ 0 ∧ δ 00 )) (∃¯ xj αj ∧ αj ∧ i∈I,i6=n ¬(∃¯ zij ij ij

0 0 ∧ βi00 )) ∧ ¬(∃¯ yn−1 βn−1 ) ∧ ¬(∃¯ yn0 βn0 )))

  ,

(3.11) 50

3.2. Zero-infinite-decomposable theory 0 0 with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , I = {1, 2, ..., n}, ∃¯ yn−1 βn−1 ∈ A0 , ∃¯ yn0 βn0 ∈ A0 , for all i ∈ I with i 6= n and i 6= n − 1 we have ∃¯ yi0 βi0 ∈ A0 and βi00 ∈ A00 and for all j ∈ Jn−1 we have ∃¯ x0j αj0 ∈ A0 , αj00 ∈ A00 , 0 0 0 00 00 ∃¯ zij δij ∈ A and δij ∈ A . (2) By repeating the preceding steps in each sub-formula of (3.9) or (3.11) of the form

∃¯ x0j αj0 ∧ αj00 ∧

0 0 00 ¬(∃¯ zij δij ∧ δij ),

^ i∈I,i6=n

we get a wnfv formula equivalent in T of the form (∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧ (



V

¬(∃¯ yi0 βi0 i∈I,i6 W=n,i6=n−1

0 0 ∧ βi00 )) ∧ ¬(∃¯ yn−1 βn−1 )))

 ∨ j∈Jn−1 T |=  V 0 δ 0 ∧ δ 00 )) (∃¯ x0j αj0 ∧ αj00 ∧ i∈I,i6=n,i6=n−1 ¬(∃¯ zij ij ij

  ,

0 0 with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , I = {1, 2, ..., n}, ∃¯ yn−1 βn−1 ∈ A0 , for all i ∈ I with i 6= n and i 6= n − 1 0 δ 0 ∈ A0 we have ∃¯ yi0 βi0 ∈ A0 and βi00 ∈ A00 and for all j ∈ Jn−1 we have ∃¯ x0j αj0 ∈ A0 , αj00 ∈ A00 , ∃¯ zij ij 00 00 and δij ∈ A . From (1) and (2) we deduce that it is enough to apply the preceding steps a finite numbers of time on each disjunction by saving the formulas of the form ¬(∃¯ yi0 βi0 ), to eliminate all sub0 0 00 formulas of the form ¬(∃¯ yi βi ∧ βi ). At the end we get a disjunction of formulas of the form

∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

^

¬(∃¯ yj0 βj0 )),

j∈J

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 , J a finite possibly empty set and for all j ∈ J we have ∃¯ yj0 βj0 ∈ A0 . 2

3.2.3

Completeness

Theorem 3.2.3.1 If T is zero-infinite-decomposable then T is complete. Proof. Let T be a zero-infinite-decomposable theory which satisfies the five conditions of Definition 2.2.1.1. Let us show that T is complete using Property 1.2.3.1 by taking formulas of the form ∃¯ x α, with α ∈ A as basic formulas. Note that according to Definition 3.2.1.1, the formulas of A0 are of the form ∃¯ xα with α ∈ A and A00 is a sub-set of A. Let us show that the first condition of Property 1.2.3.1 holds, i.e. every flat formula is equivalent in T to a wnfv boolean combination of basic formulas. If ϕ is a flat formula, then according to the fourth point of Definition 3.2.1.1, ϕ is equivalent in T to a disjunction of elements of A, thus to a disjunction of formulas of the form ∃ε α with α ∈ A, which is a boolean combination of basic formulas. Let us show that the second condition of property 1.2.3.1 holds, i.e. every basic formula without free variables is equivalent, either to true, or to false in T . Let ∃¯ x α with α ∈ A be a basic formula without free variables. According to Property 3.2.2.1, this formula is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ α00 with ∃¯ x0 α0 ∈ A0 and α00 ∈ A00 . According to the 0 fifth point of Definition 3.2.1.1, we have x ¯ = ε, α ∈ {true, false} and α00 ∈ {true, false}. Since T has at least one model then either T |= ϕ or T |= ¬ϕ. Let us show that the third condition of Property 1.2.3.1 holds, i.e. every formula of the form ∃x (

V

xi αi )) i∈I (∃¯

∧(

V

j∈J

¬(∃¯ yj βj )),

(3.12)

with αi ∈ A for all i ∈ I and βj ∈ A for all j ∈ J, is equivalent in T to a wnfv boolean combination of basic formulas, i.e. a wnfv boolean combination of formulas of the form ∃¯ xα with 51

Chapter 3. Zero-infinite-decomposable theory α ∈ A. By lifting the quantifications ∃¯ xi after having possibly renamed some variables which occur in each x ¯i , the formula (3.12) is equivalent in T to wnfv formula of the form ∃¯ x(

V

i∈I

αi ) ∧

V

j∈J

¬(∃¯ yj βj ),

with αi ∈ A for all i ∈ I and βj ∈ A for all j ∈ J. According to Definition 3.2.1.1, the set A is closed for the conjunction. Thus, the preceding formula is equivalent in T to a wnfv formula of the form V ∃¯ x α ∧ j∈J ¬(∃¯ yj βj ), with α ∈ A and βj ∈ A for all j ∈ J. According to Corollary 3.2.2.3, the preceding formula is equivalent in T to a wnfv disjunction of formulas of the form ∃¯ x0 α0 ∧ (∃¯ x00 α00 ∧

V

i∈I

¬(∃¯ yi0 βi0 )).

(3.13)

with ∃¯ x0 α0 ∈ A0 , α00 ∈ A00 and ∃¯ yi0 βi0 ∈ A0 for all i ∈ I. Let us show that each formula of this disjunction is equivalent in T to a wnfv boolean combination of basic formulas. Let ϕ be a formula of the form (3.13). Let us denote by I1 the set of the i ∈ I such that x00n has no occurrences in ∃¯ yi0 βi0 . The formula ϕ is equivalent in T to 0 0

∃¯ xα ∧

(∃x001 ...∃x00n−1

" V

#

( i∈I1 ¬(∃¯ y 0 β 0 ))∧ Vi i ). 00 00 (∃xn α ∧ i∈I−I1 ¬(∃¯ yi0 βi0 ))

Since α00 ∈ A00 and ∃¯ yi0 βi0 ∈ A0 for all i ∈ I and according to Property 3.1.0.4 and the points 2 and 3 of Definition 3.2.1.1, the preceding formula is equivalent in T , to ∃¯ x0 α0 ∧ (∃x001 ...∃x00n−1 (

V

i∈I1

¬(∃¯ yi0 βi0 )) ∧ (∃x00n α00 )),

which, since α00 ∈ A00 and according to the second point of the third condition Definition 3.2.1.1, is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ (∃x001 ...∃x00n−1 (

V

i∈I1

¬(∃¯ yi0 βi0 )) ∧ αn00 ),

with ∃¯ x0 α0 ∈ A0 , αn00 ∈ A00 and ∃¯ yi0 βi0 ∈ A0 for all i ∈ I1 , i.e. to ∃¯ x0 α0 ∧ (∃x001 ...∃x00n−1 αn00 ∧

V

i∈I1

¬(∃¯ yi0 βi0 )).

By repeating the three preceding steps n − 1 times and by denoting by Ik the set of the i ∈ Ik−1 such that x00(n−k+1) has no occurrences in ∃¯ yi0 βi0 , we get a wnfv formula equivalent in T , of the form V ∃¯ x0 α0 ∧ α100 ∧ i∈In ¬(∃¯ yi0 βi0 ), with ∃¯ x0 α0 ∈ A0 , α100 ∈ A00 and ∃¯ yi0 βi0 ∈ A0 for all i ∈ In . Since ∃¯ x0 α0 ∈ A0 , then according to 0 0 the second point of Definition 3.2.1.1, we have T |= ∃?¯ x α , thus T |= ∃?¯ x0 α0 ∧ α10 . According to Corollary 3.1.0.7, the preceding formula is equivalent in T to (∃¯ x0 α0 ∧ α100 ) ∧

V

i∈In

¬(∃¯ x0 α0 ∧ α100 ∧ ∃¯ yi0 βi0 ),

which by lifting the quantifications ∃¯ yi0 and by renaming some variables which occur in each y¯i0 , is equivalent in T to a wnfv of the form (∃¯ x0 α0 ∧ α100 ) ∧ 52

V

i∈In

¬(∃¯ x0 y¯i0 α0 ∧ α100 ∧ βi0 ),

3.2. Zero-infinite-decomposable theory with α0 , α100 , and all the βi0 element of A, and ∃¯ xα0 ∈ A0 . Since the formulas α0 , α100 , βi0 belong to A and since A is closed for the conjunction, then the preceding formula is equivalent in T to a wnfv formula of the form V (∃¯ xα) ∧ i∈In ¬(∃¯ yi βi ), with α ∈ A and βi ∈ A for all i ∈ I. This formula is a boolean combination of formulas of the form ∃¯ xα with α ∈ A, i.e. a boolean combination of basic formulas. Thus, the third condition of Property 1.2.3.1 holds. Since T satisfies the three conditions of Property 1.2.3.1, then T is a complete theory. 2 According to Theorem 3.2.3.1 and Corollary 1.2.3.2, we have the following corollary: Corollary 3.2.3.2 If T is zero-infinite-decomposable and if for every formula of the form ∃¯ x0 α0 ∧ α00 which belongs to A0 we have x ¯0 = ε and α0 ∧ α00 ∈ AT , then T accepts a full elimination of quantifiers. Proof. Let T be a zero-infinite-decomposable theory such that for each formula of the form ∃¯ x0 α0 ∧ α00 which belongs to A0 we have x ¯0 = ε and α0 ∧ α00 ∈ AT . Let ϕ be formula. In the proof of Theorem 3.2.3.1, we have shown that T satisfies the three conditions of Property 1.2.3.1 using formulas of the form ∃¯ xα with α ∈ A as basic formulas. Thus, according to Corollary 1.2.3.2, the formula ϕ is equivalent in T to a wnfv boolean combination of basic formulas, i.e. a wnfv boolean combination of formulas of the form ∃¯ xα with α ∈ A. According to Property 3.2.2.1, each one of these basic formulas is equivalent in T to a wnfv formula of the form ∃¯ x0 α0 ∧ α00 with 0 0 0 00 00 0 0 00 ∃¯ x α ∈ A and α ∈ A . Since x ¯ = ε and since α ∧ α ∈ AT , then the formula ϕ is equivalent in T to a wnfv boolean combination φ of conjunctions of atomic formulas. According to the definition of the atomic formulas (Chapter 1), it is clear that φ does not contain quantifiers. 2 Let us now present a property that links the infinite-decomposable theories to the zeroinfinite-decomposable theories. According to Property 3.1.0.5 and Property 2.1.2.3, we have: Property 3.2.3.3 An infinite-decomposable theory T is zero-infinite decomposable if for each formula of the form ∃¯ x00 α00 ∈ A00 , the formula ¬α00 is equivalent in T to a disjunction of elements of A. It is obvious that the sets A and A00 cited in this property are those that appear in the definition of the infinite-decomposable theory and not those of the definition of the zero-infinite-decomposable theories. The theories Eq, Ra and T presented in Chapter 2, are zero-infinite-decomposable. In fact, we have shown their infinite-decomposability using a set A00 containing formulas of the form ∃¯ x00 true. Thus, since ¬true is equivalent to the formula false in all these theories and since the formula false belongs to A, then each one of these theories are zero-infinite-decomposable.

3.2.4

Fundamental example

Let F be an empty set of function symbols and R a set of relation symbols containing only the binary relation symbol 0. Here αp is a solved block and is called propagated constraint section, αc is a basic formula and is called core constraint section, the ϕi are working formulas, and in the conditions: β p ∧ β c is the conjunction of the equations and relations of the immediate top-working formula ψ of φ if V it exists, i.e. ψ = ¬k (∃¯ y β c ∧ β p ∧ φ ∧ j∈J φj ) with φj working formulas. 1. if ψ exists then T |= αp ∧ αc → β p ∧ β c , and the tree-sections of αp and β c ∧ β p have the same set of left-hand side of equations, 2. the tree-section of αp ∧ αc is formatted and the formula αp ∧ αc does not contain ¬numx ∧ numx for any variable x, 3. αp ∧ αc is a block, 4. the numeric-section of αp ∧ αc is consistent, and we have u  v for u any unreachable variable in x ¯ and v any reachable variable in x ¯, 5. αp ∧ αc is a solved block, 6. αp is the formula β c ∧ β p if ψ exists, and is the formula true otherwise. The formula αc is a solved block and for each relation numx (or ¬numx) in αp , if x does not occur in an equation or inequation of αc then numx (resp. ¬numx) does not occur in αc , 7. (∃¯ x αc ) is decomposable into (∃¯ x1 αc1 ∧ (∃¯ x2 αc2 ∧ (∃ε true))), 8. (∃¯ x αc ) is decomposable into (∃¯ x1 αc1 ∧ (∃ε αc2 ∧ (∃ε true))), 9. (∃¯ x αc ) is decomposable into (∃¯ x1 αc1 ∧ (∃ε true ∧ (∃ε true))). The intuitions behind this definition come from an aim to be able to control the execution of our rewriting rules according to each value of k in a working formula. We strongly insist in the fact that ¬k does not mean that the normalized formula satisfies only the k th condition but all the conditions i with 1 ≤ i ≤ k. We call initial working formula a working formula of the form ¬6 (∃ε true ∧

^

ϕi )

i∈I

with ϕi working formulas where all negation symbols ¬k have k = 0 and all propagated constraint sections are reduced to the formula true. We call final working formula a formula of the form ¬7 (∃ε true ∧

^

¬8 (∃¯ xi αic ∧ αip ∧

i∈I

^

p c ¬9 (∃¯ yij βij ∧ βij ))),

(5.5)

j∈Ji

c are different from the formula true. where the βij

111

∗ Chapter 5. Solving first order constraints in Tad

Definition 5.3.1.4 A general solved formula is a formula of the form ∃¯ x1 α1 ∧ α2 ∧

^

¬(∃¯ yi1 βi1 ),

(5.6)

i∈I

where ∃¯ x1 α1 ∈ A1 , α2 ∈ A2 , ∃¯ yi1 βi1 ∈ A1 , all the α1 ∧ α2 ∧ βi1 are solved blocks and all the βi1 are different from true. According to the properties of ¬8 and ¬9 , in the final working formula (5.5), αip = true and p βij = αip ∧ αic . Thus, the formula (5.5) is equivalent in T to the following disjunction of general solved formulas ^ _ c (∃¯ xi αic ∧ ¬(∃¯ yij βij )) (5.7) j∈Ji

i∈I

Thus, we have the following property ∗ to a disProperty 5.3.1.5 Every working final formula of the form (5.5) is equivalent in Tad junction (5.7) of general solved formulas.

Property 5.3.1.6 Let ϕ be a working formula of the form ¬k (∃¯ x αc ∧ αp ∧

^

φi )

i∈I

with 6 ≤ k ≤ 9 and φi working formulas. We have T |= ¬(∃¯ x αc ∧ αp ∧

^

φ∗i ) ↔ ¬(αp ∧ (∃¯ x αc ∧

i∈I

^

φ∗i ))

i∈I

with φ∗i the normalized formula obtained from φi by replacing all ¬k by ¬. Proof Let ψ - if it exists - be the immediate top-working formula of ϕ. Thus, ψ is of the form ¬k (∃¯ yβ c ∧ β p ∧ ϕ ∧

^

φ0j )

j∈J

with φ0j working formulas. According to Definition 5.3.1.3, since k ≥ 6 then the normalized formula satisfies the k first conditions of this definition and thus according to the sixth point of this definition we have two cases: (1) if φ does not exists, then αp is the formula true according to the sixth condition of Definition 5.3.1.3. Thus, the property is true. (2) if φ exists, then αp = β p ∧ β c according to the sixth condition of Definition 5.3.1.3. Since the variables of x ¯ can not occur in β c ∧ β p , then these variables can not occur in αp , thus we can lift the formula αp before the quantification ∃¯ x and thus the property is true. ∗ which shows the differences Let us present now one of the most important property in Tad between the decision procedures defined in Chapter 2 and 3 and an algorithm solving general ∗ . first order constraints in Tad Property 5.3.1.7 Let ϕ be a general solved formula of the form (5.6). If ϕ has no free variables then ϕ is the formula true, otherwise neither T |= ϕ nor T |= ¬ϕ 112

∗ 5.3. Solving first order constraints in Tad

Proof. Let ϕ be a general solved formula of the form ∃¯ x1 α1 ∧ α2 ∧

^

¬(∃¯ yi1 βi1 ),

(5.8)

i∈I

where ∃¯ x1 α1 ∈ A1 , α2 ∈ A2 , ∃¯ yi1 βi1 ∈ A1 , all the α1 ∧ α2 ∧ βi1 are solved blocks and all the βi1 are different from true. Two cases arise: Case 1: Let us show that if ϕ has no free variables then ϕ is the formula true. Since ϕ has no free variables then ∃¯ x1 α1 ∧ α2 has no free variables. Since ∃¯ x1 α1 ∈ A1 and has no free variables then according to Property 5.2.3.1 the formula (5.8) is equivalent in T to the following formula without free variables ^ α2 ∧ ¬(∃¯ yi1 βi1 ), (5.9) i∈I

α2

A2

α2

Since ∈ and has no free variables then according to the definition of the set A2 we have ∗ to the following formula without α2 = true. Thus, the preceding formula is equivalent in Tad free variables ^ ¬(∃¯ yi1 βi1 ). (5.10) i∈I

∃¯ yi1 βi1

A1

Since ∈ and has no free variables, then using Property 5.2.3.1, we deduce that ∃¯ yi1 βi1 = 1 ∃εtrue. But according to the condition of the formula (5.8) all the formulas βi are different from ∗ . true and thus I must be the empty set. Thus, the preceding formula is equivalent to true in Tad Case 2: if ϕ has at least one free variable, then let us show that there exists at least a model ∗ and two distinct instantiations ϕ0 and ϕ00 of ϕ by individuals of M such that M of Tad M |= ¬ϕ0

and

M |= ϕ00 .

∗ given in Chapter 4.24 Let us choose for example for M the standard model of Tad (1) Let us show that ϕ0 exists. Let z be a free variable of ϕ:

• If z occurs in the formula α1 ∧ α2 then since ∃¯ x1 α1 ∈ A1 and α2 ∈ A2 , the formulas α1 and 2 α are solved blocks, thus all the variables are typed, thus numz or ¬numz is a sub formula of α1 ∧ α2 . To make false ϕ0 it is enough to instantiate the free variable z by an element of Q if ¬numz is a sub formula of α1 ∧ α2 ; and by h if numz is a sub formula of α1 ∧ α2 with h ∈ F − {0, 1} a 0-ary function symbol, i.e. a tree constant. By this instantiation ϕ0 , we make a contradiction in the typing of z, thus M |= ¬ϕ0 . • Else, there exists k ∈ I such that the formula ∃¯ yk1 βk1 with k ∈ I has at least one free variable. Since ∃¯ yk1 βk1 ∈ A1 , then βk1 is a solved block then according to Property 5.2.1.2 there exists an instantiation ∃¯ y 1 β 01 of the free variables of ∃¯ yk1 βk1 such that M |= ∃¯ yk1 βk01 V k k 1 1 1 1 2 0 thus M |= ¬(∃¯ x α ∧ α ∧ i∈I ¬(∃¯ yi βi )), thus M |= ¬ϕ . (2) Let us show now that there exists ϕ00 such that M |= ϕ00 . The formula ϕ is of the form ∃¯ x1 α1 ∧ α2 ∧

^

¬(∃¯ yi1 βi1 ),

(5.11)

i∈I

where ∃¯ x1 α1 ∈ A1 , α2 ∈ A2 , ∃¯ yi1 βi1 ∈ A1 , all the α1 ∧ α2 ∧ βi1 are solved blocks and all the βi1 are different from true. 24 This model has as domain the set of finite or infinite trees labeled by Q ∪ F and such that each sub-tree labeled by Q ∪ {+, −} is evaluated in Q and reduced to a leaf labeled by Q.

113

∗ Chapter 5. Solving first order constraints in Tad

Let α2∗ be the formula α2 in which we have removed the typing constraints which concern the leaders of the equations of α1 . Let us also transform the equations of the numeric section of α1 and βi1 by moving to the right hand sides the terms containing variables that are not leaders (see ∗ to Property 5.1.1.1). The preceding formula is equivalent in Tad ∃¯ x1 α1 ∧ α2∗ ∧

^

¬(∃¯ yi1 βi1 ),

(5.12)

i∈I

α1

where the equations of the numeric section of (respectively βi1 ) have distinct left hand sides which have no occurrences in other right hand sides of equations of the numeric section of α1 (respectively βi1 ). This is due to the fact that ∃¯ x1 α1 ∈ A1 and ∃¯ yi1 βi1 ∈ A1 , and thus α1 and βi1 are solved. Since ∃¯ yi1 βi1 ∈ A1 then βi1 is a solved block, thus it is consistent and different from false. Moreover since βi1 are different from true then each βi1 has at least a variable. According to the definition of A1 all the variables of y¯i1 are reachable and thus there exists at least one free variable in each βi1 according to the definition of the reachable variables. Since α1 ∧ α2∗ ∧ βi1 are solved blocks then they are consistent and thus there exists an instantiation of ∃¯ x1 α1 ∧ α2∗ such that this instantiated formula is true in M (Property 5.2.1.2), thus according to Property 5.2.3.3 there exists an infinity of instantiations of the variables of α2∗ which make it true in M (and not zero because there exists at least an instantiation since the blocks are solved). For each value of these instantiations and for all instantiations of the right hand sides of the equations of the numeric section of α1 , there exists a value for the leaders of these equations because the leaders of the equations of α1 do not occur in α2∗ ( α1 ∧ α2 ∧ βi1 are solved blocks). For each of these values and instantiations of the variables of the equations of the tree section of α1 which are not leaders, there exists a value for the leaders of these equations (axiom 3). Then, there exists an infinity of instantiations of the free variables of ∃¯ x1 α1 ∧ α2 which make the instantiated formula true in M . Let us show now that there exists from this infinity of instantiations, an instantiation which makes false each formula of the form ∃¯ yi1 βi1 and thus makes true ϕ00 . In each sub-formula of the form ∃¯ yi1 βi1 the leaders of the equations of the numeric section of βi1 do not occur in the equations and inequations of α1 ∧ α2 because α1 ∧ α2 ∧ βi1 are solved blocks. Since for each instantiation of the right hand sides of the equations of the numeric section of βi1 there exists a value for the leaders. Thus, it is enough to choose a different value to these leaders to make false all the ∃¯ yi1 βi1 . This is possible because the domain M is infinite and more exactly Q is infinite. For each instantiation of the variables which are not leaders in the tree section of βi1 there exists a unique value for the leaders, thus it is enough to take another value to make false all the ∃¯ yi1 βi1 . This is possible because the domain of the trees is infinite and more exactly the set of the function symbols of F is infinite. Thus there exists an instantiation which make true ∃¯ x1 α1 ∧ α2 and false each sub-formula of the form ∃¯ yi1 βi1 . Thus, this instantiation is the formula ϕ00 . Property 5.3.1.8 Every general solved formula is equivalent in T to a boolean combination of formulas of the form ∃¯ x1 α1 ∧ α2 , with ∃¯ x1 α1 ∈ A1 and α2 ∈ A2 , which do not accept elimination of quantifiers. Proof. Let ϕ be the following general solved formula _ i∈I

(∃¯ xi αic ∧

^

c ¬(∃¯ yij βij ))

(5.13)

j∈Ji

c are different from true. The formula ϕ is extracted from a final working formula where the βij

114

∗ 5.3. Solving first order constraints in Tad

of the form ¬7 (∃true

^

¬8 (∃¯ xi αic ∧ αip ∧

i∈I

^

p c ¬9 (∃¯ yij βij ∧ βij ))

j∈Ji

According to the conditions of ¬8 , we have αip = true and all the variables of x ¯i are reachable in ∗ into ∃¯ ∃¯ xi αic . Moreover, ∃¯ xi αic is decomposed in Tad xi αic1 ∧ αic2 , with ∃¯ xi αc1i ∈ A1 and αic2 ∈ A2 . p c ∧ β p are solved blocks According to the conditions of ¬9 , we have βij = αic ∧ αip = αic , the βij ij c belong to A1 . Thus, we deduce that β c ∧αc are solved blocks. Since each variable and the ∃¯ yij βij ij i c . Since each variable y in y in x ¯i is reachable in ∃¯ xi αic , it remains reachable in ∃¯ xi y¯ij αic ∧ βij ¯ij c is reachable in ∃¯ yij βij , two cases arise: (1) y is reachable without using variables in x ¯i , in this c , (2) y is reachable using variables in x case, y remains reachable in ∃¯ xi y¯ij αic ∧ βij ¯i , in this case, c c since all variables in x ¯i are reachable in ∃¯ xi y¯ij αi ∧ βij , then y is still reachable in this formula. c can be decomposed into ∃¯ c ∧αc2 , with ∃¯ Thus, the formulas ∃¯ xi y¯ij αic ∧βij xi y¯ij αic1 ∧βij xi y¯ij αic1 ∧ i c ∈ A1 and αc2 ∈ A2 . βij i According to Property 5.2.1.1, the formula (5.13) is equivalent in T to the formula _ i∈I

((∃¯ xi αic ) ∧

^

c ¬(∃¯ xi y¯ij αic ∧ βij ))

j∈Ji

We have proved that each quantified conjunction is of the form ∃¯ x1 α1 ∧ α2 where x ¯1 α1 ∈ A1 and 2 2 α ∈ A . This property is then proved.2

5.3.2

Main idea

The general algorithm for solving first-order constraints in T uses a system of rewriting rules. The main idea is to transform an initial working formula of depth d into a final working formula of depth less than or equal to three. The transformation is done in two steps: (1) The first step is a top-down simplification and propagation. In each sub-working formula, c α ∧ αp is transformed into a solved block, then ∃¯ xαc is decomposed into three parts. The third part is eliminated and added to the core-constraint section of the immediate sub-working formulas using a special property of the quantifier ∃!. The constraints of the two other parts in αp are propagated to the propagated-constraint section of the immediate sub-working formulas. In this step, the rules 1 to 24 are applied and transform the initial working formula into a working formula where each negation symbol is of the form ¬7 . (2) The second step is a bottom-up simplification and elimination of quantifiers. This step is done by the rules 25 to 28. In each sub-working formula of depth one or two, the rule 25 eliminates quantified variables of the second part of the decomposition (the third one had been already removed in the first step). The rule 26 eliminates the constraints of the second part in the deepest level. Each sub-working formula of depth 3 is transformed step by step to a conjunction of working formulas of depth 2 by the rule 28 using a property of the quantifier ∃?. The transformations in this step can create new sub-working formulas where the first step needs to be done. At the end of the transformations, we obtain a final working formula of depth less than or equal to 3.

5.3.3

The rewriting rules

We present now the rewriting rules which transform an initial working formula to a final working ∗ . To apply the rule p =⇒ p to the working formula p means formula, which is equivalent in Tad 1 2 115

∗ Chapter 5. Solving first order constraints in Tad

to replace in p, a sub-formula p1 by the formula p2 , by considering that the connector ∧ is associative and commutative.

¬1 (∃¯ u num x ∧ tree x ∧ α ∧ ϕ) 1 ¬ (∃¯ u x = f y¯ ∧ x = g¯ z ∧ tree x ∧ α ∧ ϕ) ¬1 (∃¯ u x = x ∧ α ∧ ϕ) ¬1 (∃¯ " u y = x ∧ tree x ∧ α ∧ ϕ) # ∃¯ u x = f y ...y ∧ x = f z ...z ∧ 1 n 1 n 5 ¬1 tree x ∧ α ∧ ϕ " # ∃¯ u x = y ∧ x = f z1 ...zn ∧ 1 6 ¬ tree x ∧ tree y ∧ α ∧ ϕ 1 7 ¬ (∃¯ u x = y ∧ x = z ∧ tree x ∧ α ∧ ϕ) 8 ¬4 (∃¯ u 0 = 0.1 ∧ α ∧ ϕ) 9 ¬4 (∃¯ " u 0 < a0 .1 ∧ α ∧ ϕ) # ∃¯ u x = y∧ 4 10 ¬ num x ∧ num y ∧ α ∧ ϕ

1 2 3 4

∃¯ u x = −y∧ num x ∧ num y ∧ α ∧ ϕ

#

∃¯ u x = y + z ∧ num x∧ num y ∧ num z ∧ α ∧ ϕ   ∃¯ u Σni=1 ai .xi = a0 .1∧   ¬4  Σnj=1 bj .xj = b0 .1∧  V num x ∧ α ∧ ϕ   ∃¯ u Σni=1 ai .xi = a0 .1∧   ¬4  Σnj=1 bj .xj < b0 .1∧  V num x ∧ α ∧ ϕ ¬1 (∃¯ x αc ∧ αp ∧ ϕ) ¬2 (∃¯ x αc ∧ αp ∧ ϕ) 2 ¬ (∃¯ x αc ∧ αp ∧ ϕ)

#

"

11

¬4 "

=⇒ =⇒ =⇒ =⇒ =⇒ =⇒ =⇒ =⇒ =⇒ =⇒

true true ¬1 (∃¯ u α ∧ ϕ) ¬1 (∃¯ ∧ ϕ) " u x = y ∧ tree x ∧ α # V ∃¯ u x = f y ...y ∧ y = z ∧ 1 n i i i ¬1 tree x ∧ α ∧ ϕ " # ∃¯ u x = y ∧ y = f z1 ...zn ∧ 1 ¬ tree x ∧ tree y ∧ α ∧ ϕ 1 ¬ (∃¯ u x = y ∧ y = z ∧ tree x ∧ α ∧ ϕ) ¬4 (∃¯ u α ∧ ϕ) ¬4 (∃¯ " u α ∧ ϕ) # ∃¯ u x + (−1).y = 0.1∧ 4 ¬ num x ∧ num y ∧ α ∧ ϕ "

=⇒

¬4

∃¯ u x + y = 0.1∧ num x ∧ num y ∧ α ∧ ϕ

#

"

#

18 ¬2 (∃¯ x αc ∧ αp ∧ ϕ)

=⇒

19 20 21 22

¬2 (∃¯ x αc ∧ αp ∧ ϕ) 3 ¬ (∃¯ x αc ∧ αp ∧ ϕ) ¬3 (∃¯ x αc ∧ αp ∧ ϕ) 4 ¬ (∃¯ x αc ∧ αp ∧ ϕ)

=⇒ =⇒ =⇒ =⇒

∃¯ u x + (−1).y + (−1).z = 0.1∧ num x ∧ num y ∧ num z ∧ α ∧ ϕ   ∃¯ u Σni=1 ai .xi = a0 .1∧   ¬4  Σni=1 (bk ai − ak bi ).xi = (bk a0 − ak b0 ).1∧  V num x ∧ α ∧ ϕ   ∃¯ u Σni=1 ai .xi = a0 .1∧   ¬4  Σni=1 λ(bk ai − ak bi ).xi < (bk a0 − ak b0 ).1∧  V num x ∧ α ∧ ϕ ¬2 (∃¯ x αc ∧ αp ∧ ϕ) ¬1 (∃¯ x num z ∧ αc ∧ αp ∧ ϕ) 1 ¬ x tree z ∧ αc ∧ αp ∧ ϕ) " (∃¯ # ¬1 (∃¯ x num z ∧ αc ∧ αp ∧ ϕ)∧ ¬1 (∃¯ x tree z ∧ αc ∧ αp ∧ ϕ) ¬3 (∃¯ x αc ∧ αp ∧ ϕ) true ¬4 (∃¯ x αc ∧ αp ∧ ϕ) 5 ¬ (∃¯ x αc ∧ αp ∧ ϕ)

23

¬7

=⇒

¬7

24

¬6

=⇒

¬7

12 13

14 15 16 17

¬4

"

"

"

25 ¬7 "

26

116

¬7

∃¯ x αc ∧ αp ∧ ϕ∧ ¬5 (∃¯ y β c ∧ β p ∧ ψ)

=⇒

=⇒ =⇒ =⇒ =⇒

#

∃¯ x αc ∧ αp ∧ V 0 yi βic ∧ βip ∧ ϕi ) i ¬ (∃¯ ∃¯ x αc ∧ αp ∧ V 9 y βc ∧ βp) i i i∈I ¬ (∃¯ i ∃¯ x αc ∧ αp ∧ ϕ∧ ¬8 (∃¯ yβ c ∧ β p)

=⇒

¬4

#

#

=⇒ ¬8

#

"

=⇒

"

∃¯ x αc ∧ αp ∧ ϕ∧ ¬6 (∃¯ y γ c ∧ γ p ∧ ψ)

#

"

∃¯ x1 x ¯2 αc1 ∧ αc2 ∧ αp ∧ V 1 yi x ¯3 γic ∧ γip ∧ ϕi ) i ¬ (∃¯

"

∃¯ x1 αc1 ∧ αc2∗ ∧ αp ∧ V 9 y β c ∧ β p∗ ) i i i∈I 0 ¬ (∃¯ i

#

#

¬7 (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬9 (∃¯ y β c1 ∧ β p ))∧ V 1 xy ¯β p ∧ β c1 ∧ βic2∗ ∧ ϕ0 ) i∈I ¬ (∃¯

#

∗ 5.3. Solving first order constraints in Tad

"

27

¬7

∃¯ x αc ∧ αp ∧ ϕ∧ ¬9 (∃εtrue ∧ β p )

#

=⇒ true

 7  ∃¯ x αc ∧ αp ∧ ϕ∧    ¬ (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬8 (∃¯ y β c ∧ β p ))∧ c ∧ βp∧  ^ ∃¯ y β  =⇒   28 ¬7  ¬6 (∃¯ xy¯z¯i δic ∧ δip ∧ ϕ0 )  ¬8  ^ 9  ¬ (∃¯ zi γic ∧ γip )  



i∈I

i∈I

In all these rules, α is a basic formula, ϕ and ψ are conjunctions of working formulas. In the rules 1 to 14, the equations and relations in αc and αp are mixed by considering the connector ∧ associative and commutative. In these rules, except the rule 6, all modifications in the right hand side are done in αc , since αp is a solved block. In the rule 2, f and g are two distinct function symbols taken from F . In the rules 4, 6, 7 x  y This condition prevents infinite loops and makes the procedure terminating. In the rule 5, the equation x = f z1 ...zn does not belong to αp . In the rule 6, if the equation x = f z1 ...zn belongs to αp , then x = y ∧ ¬numy is moved to αp . In the rule 7, the equation x = z does not belong to αp . We recall that the notation 0.1 in the rule 8 means the term 0. In the rule 9, a0 > 0. In the rules 13 and 14 the variable xk is the leader of the equation Σi ai xi = a0 1 and bk 6= 0. Moreover the equation Σi bi .xi = b0 .1 does not belong to αp . In the rule 14, the relation Σi bi .xi < b0 .1 does not belong to αp and λ = 1 if ak > 0 and λ = −1 otherwise. In the rule 15, the tree section of αc ∧αp is formatted and there is no sub-formula in αc ∧αp of the form numx∧¬numx. In the rule 16 respectively 17, the typing constraint numz, respectively ¬numz is not in αc ∧ αp and is a consequence of αc ∧ αp . In the rule 18, z does not have typing constraint in αc ∧ αp and neither numz nor ¬numz is a consequence of αc ∧ αp . In the rule 19, αc ∧ αp is a block. In the rule 20, the numeric section of αc ∧ αp is inconsistent. In the rule 21, the unreachable variables in x ¯ are renamed if necessary such that u  v for each unreachable variable u and each reachable variable v in x ¯ and the numeric section of αc ∧ αp is consistent. The consistency can be verified for example by using the first step of the Simplex. In the rule 22, αc ∧ αp is a solved block. In the rule 23, γ c is obtained from β c as follows: for all variable x ∈ var(β c ), we add all the relations numx or ¬numx which are in β p but not in β c , and for all the variables y which do not occur in an equation or inequation of β c we remove all relations numy or ¬numy which are both in β c and β p . The formula γ p is the formula αp ∧ αc . In the rule 24, ∃¯ xαc is decomposed to ∃¯ x1 αc1 ∧ (∃¯ x2 αc2 ∧ (∃¯ x3 αc3 )), γic = βic ∧ αc3 and p p c1 c2 p γi = βi ∧ α ∧ α ∧ α . The four rules 25, 26, 27 and 28 can not be applied on the occurrence of ¬7 of the first level of the general working formula. In the rule 25, I 0 is the set of i ∈ I such that βic does not contain occurrences of any variables in x ¯2 . The formula αc2∗ is such that T |= (∃¯ x2 αc2 ) ↔ αc2∗ and is computed using the Fourier quantifier elimination. The propagated-constraint section βip∗ = αc1 ∧ αc2∗ ∧ αp . In the rule 26, ϕ is such that every negation symbol ¬k has k ≥ 6, ϕ0 is obtained from ϕ by replacing all occurrences of ¬k by ¬0 and all propagated-constraint sections by true. Let β 2 the formula obtained from β c2 by removing the multiple occurrences of typing constraints and for all the variables y which do not occur in an inequation of β c2 we remove all relation numy or ¬numy which are both in β c1 and β c2 . If β 2 is the formula true then I = ∅, otherwise the βic2∗ with i ∈ I are obtained from β 2 as follows: Since β 2 ∈ A2 then it is of the form " V V ( `∈L numz` ) ∧ ( k∈K ¬numvk )∧ Vn V Pn

((

j∈J

i=1 aij .xi

< a0j .1) ∧

#

m=1 numxm )

, 117

∗ Chapter 5. Solving first order constraints in Tad

thus ¬β 2 is of the form  W  W W ( `∈L ¬num z` ) ∨ ( k∈K numvk ) ∨ ( nm=1 ¬numxm )∨ Pn Vn W   j∈J (( i=1 aij xi = a0j .1 ∧ m=1 numxm )∨  Pn Vn

(

i=1 (−aij )xi

< (−a0j ).1 ∧

m=1 numxm ))

Each element of this disjunction is a block and represents a formula βic2∗ . Of course we have W T |= (¬β 2 ) ↔ i βic2∗ . In the rule 28, I 6= ∅, ϕ is such that every negation symbol ¬k has k ≥ 6, ϕ0 is obtained from ϕ by replacing all occurrences of ¬k by ¬0 and all propagated-constraint sections by true. Moreover δip = αp and δic = γic ∧ β c ∧ αc . Property 5.3.3.1 Every repeated application of the preceding rewriting rules on an initial work∗ . ing formula terminates and produces a wnfv final working formula equivalent in Tad Proof, first part: Let us show that every repeated application of these rules on an initial working formula terminates. Note that the rules 1...7 are applied on sub-working formulas which begin by the symbol ¬1 without changing the value of this symbol. By the same way, the rules 8 ...14 are applied on sub-working formulas which begin by the symbol ¬4 . Let us then divide this proof into three parts: (1) every application of the rules 1...7 on a working formula which begins by ¬1 terminates, (2) every repeated application of the rules 8...14 on a sub-working formula which begins by ¬4 terminates, (3) every repeated application of the rules 15 ... 28 terminates. (1) Let us show that every application of the rules 1... 7 on a sub-working formula which begins by ¬1 (∃¯ xα ∧ ϕ) terminates. Since the variables of V are ordered by a linear dense order relation  without endpoints, then we can associate to each variable x a positive integer no(x), such that x  y if no(x) > no(y). Let the 3-tuple (n1 , n2 , n3 ) where • n1 is the number of equations of the form x = f y1 ...yn in α, • n2 is the sum of the no(x) for all occurrences of a variable x in α, • n3 is the number of equations of the form y = x with x  y in α. for each rule, there exists a row i such that the application of the rules decreases or does not change the values of nj , with 1 ≤ j < i, and decreases the value of ni . This row i is equal to 1 for the rules (2) and (5), 2 for the rules (1), (3), (6) and (7), and 3 for the rule (4). To each sequence of formulas obtained by finite application of the rules, we can associate a series of 3-tuples of the form (n1 , n2 , n3 ) which is strictly decreasing in the lexicographic order. Since the ni are positive integers, they can not be negative and thus this series is finite and the application of the rules 1...7 terminates. (2) Let us show now that every application of the rules 8...14 on a sub-working formula which begins by ¬4 terminates. This termination is evident since the rules 8 ...12 transform the equations and inequations into a basic form and the rules 13 and 14 remove the double occurrences of the leaders. (3) Let us show now that every repeated application of the rules 15 ... 28 terminates. Starting with an initial working formula of the form ¬6 (∃εtrue ∧ ϕ), with ϕ a conjunction of working formulas where all the negations are of the form ¬0 , the rule 24 is the only one that can be applied by changing the ¬6 to ¬7 and all the internal ¬0 to ¬1 . According to what we have shown every repeated application of the rules 1... 7 on a sub-working formula which begins by ¬1 terminates. Then, the rule 15 changes ¬1 into ¬2 . For every sub-working formula which 118

∗ 5.3. Solving first order constraints in Tad

begins by ¬2 , the rules 16, 17 and 18 can be applied at most one time for each free variable which has not yet a typing constraint in αc ∧ αp . These rules create new working formulas which begins by ¬1 . This loop is finite since we never add new untyped variables during the application of this part of rules. Note also that every application of the rules 19 to 24 terminates. Concerning the rules 25 and 27, they can be applied one and only one time on each sub-working formula. In the rule 26, we replace a sub-working formula containing a sequence of ¬7 ¬8 by the same working formula with a sequence ¬7 ¬9 and containing |I| working formulas where the sequence of ¬8 has been removed. In the rule 28 we decrease the size of the depth of the working formula. Thus, we can not apply infinitely these rules. This is a semi-formal proof ; we can make a better proof using a big n-tuples due to the high number of rules. ∗ . The rules 1..14 are evident Proof, second part: Let us show that the rules are correct in Tad ∗ ∗ in Tad and come from the axiomatization of Tad . In the rule 15, since the tree section of αc ∧ αp is formated and does not contain sub-formulas of the form num x ∧ tree x, the symbol ¬1 can be changed into ¬2 . Thus, this rule is correct. In the rule 16, since num z is a consequence of αc ∧ αp , then the formula αc ∧ αp is equivalent ∗ to αc ∧ αp ∧ num z. Thus, this rule is correct. By the same way, we show the correctness in Tad of the rules 17 and 18. In the rule 20, since the numeric section of αc ∧ αp is inconsistent, then the formula αc ∧ αp ∗ to false. Thus, this rule is correct. is equivalent in Tad The rules 19, 21 and 22 are correct because their conditions are sufficient to change their negation symbols into ¬3 , ¬4 , ¬5 (respectively) Correctness of the rule 23: " 7

¬

#

"

#

∃¯ x αc ∧ αp ∧ ϕ∧ ∃¯ x αc ∧ αp ∧ ϕ∧ =⇒ ¬7 6 5 c p ¬ (∃¯ y β ∧ β ∧ ψ) ¬ (∃¯ y γ c ∧ γ p ∧ ψ)

where γ c is obtained from β c as follows: for all variable x ∈ var(β c ), we add all the relations numx or ¬numx which are in β p but not in β c , and for all the variables y which do not occur in an equation or inequation of β c we remove all relations numy or ¬numy which are both in β c and β p . The formula γ p is the formula αp ∧ αc . ∗ . Thus, let β p be the tree section of β p and We know that β c ∧β p is equivalent to γ c ∧β p in Tad t cp p p βn the numeric section of β . Let αt be the tree section of αc ∧ αp and αncp the numeric section of αc ∧ αp . According to the conditions of ¬5 , αtcp and βtp have the same set of variables which ∗ |= β c ∧ β p → αc ∧ αp . occur in the left hand sides of equations. We have also αncp = βnp and Tad Thus T |= γ c ∧ β p → γ c ∧ αc ∧ αp , i.e. T |= γ c ∧ βtp ∧ βnp → γ c ∧ αtcp ∧ αncp , and thus T |= γ c ∧ βtp ∧ αncp → γ c ∧ αtcp ∧ αncp . Since the tree sections of γ c ∧ βtp and γ c ∧ αtcp have the same set of variables which occur in the left hand sides of equation and according to Property 5.2.2.3, we have T |= γ c ∧ βtp ∧ αncp ↔ γ c ∧ αtcp ∧ αncp , thus T |= β c ∧ β p ↔ γ c ∧ αc ∧ αp . 119

∗ Chapter 5. Solving first order constraints in Tad ∗ . Since γ p = αc ∧ αp then the rule 23 is correct in Tad Correctness of the rule 24:

"

¬6

∃¯ x αc ∧ αp ∧ V 0 yi βic ∧ βip ∧ ϕi ) i ¬ (∃¯

#

"

¬7

=⇒

∃¯ x1 x ¯2 αc1 ∧ αc2 ∧ αp ∧ V 1 yi x ¯3 γic ∧ γip ∧ ϕi ) i ¬ (∃¯

#

with γic = βic ∧ αc3 and γip = βip ∧ αc1 ∧ αc2 ∧ αp . According to Definition 5.3.1.3 of working formula, since we have the symbol ¬6 then βip = ∗ to a formula of the form αc ∧ αp . Thus, the left hand side of this rule is equivalent in Tad ¬(∃¯ x αc ∧ αp ∧

^

¬(αc ∧ αp ∧ (∃¯ yi βic ∧ ϕi ))),

i

thus to ¬(∃¯ x αc ∧ αp ∧

^

¬(∃¯ yi βic ∧ ϕi )).

i ∗ to According to Property 5.3.1.6, the preceding formula is equivalent in Tad

¬(αp ∧ (∃¯ x αc ∧

^

¬(∃¯ yi βic ∧ ϕi ))).

i

According to Definition 5.3.1.3 of working formula, since we have ¬6 then the conditions 4,5,6 ∗ . The preceding of Definition 5.3.1.3 hold. Thus, the formula ∃¯ xαc can be decomposed in Tad ∗ formula is thus equivalent in Tad to a formula of the form ¬(αp ∧ (∃¯ x1 αc1 ∧ (∃¯ x2 αc2 ∧ (∃¯ x3 αc3 ∧

^

¬(∃¯ yi βic ∧ ϕi ))))),

i ∗ |= ∀¯ with Tad x2 αc2 → ∃!¯ x3 αc3 . According to Corollary 3.1.0.8 of Chapter 3, the preceding ∗ formula is equivalent in Tad to

¬(αp ∧ (∃¯ x1 αc1 ∧ (∃¯ x2 αc2 ∧

^

¬(∃¯ x3 y¯i αc3 ∧ βic ∧ ϕi )))),

i

i.e. to

"

¬

∃¯ x1 x ¯2 αc1 ∧ αc2 ∧ αp ∧ V x3 y¯i αc3 ∧ βic ∧ αc1 ∧ αc2 ∧ αp ∧ ϕi ) i ¬(∃¯

#

.

∗ . This rule is thus correct in Tad Correctness of the rule 25:

"

¬7

∃¯ x αc ∧ αp ∧ V 9 y βc ∧ βp) i i i∈I ¬ (∃¯ i

#

"

=⇒ ¬8

∃¯ x1 αc1 ∧ αc2∗ ∧ αp ∧ V 9 y β c ∧ β p∗ ) i i i∈I 0 ¬ (∃¯ i

#

where I 0 is the set of i ∈ I such that βic does not contain occurrences of any variables in x ¯2 . The c2∗ ∗ 2 c2 c2∗ formula α is such that Tad |= (∃¯ x α )↔α and is computed using the Fourier quantifier elimination. The propagated-constraint section βip∗ = αc1 ∧ αc2∗ ∧ αp . According to Definition 5.3.1.3 of working formula, since we have ¬9 , then the sixth condition ∗ to of this definition holds, thus βip = αc ∧ αp . The left hand side of this rule is equivalent in Tad a formula of the form ¬(∃¯ x αc ∧ αp ∧

^ i

120

¬(αc ∧ αp ∧ (∃¯ yi βic ∧ ϕi ))),

∗ 5.3. Solving first order constraints in Tad

i.e. to ¬(∃¯ x αc ∧ αp ∧

^

¬(∃¯ yi βic ∧ ϕi )).

i ∗ to a formula of the form which according to Property 5.3.1.6 is equivalent in Tad

¬(αp ∧ (∃¯ x αc ∧

^

¬(∃¯ yi βic ∧ ϕi ))).

i

According to Definition 5.3.1.3 of working formula, since we have ¬7 , then the conditions 4,5,6 and ∗ with ∃¯ 7 of this definition hold. Thus the formula ∃¯ xαc can be decomposed in Tad x3 αc3 = ∃εtrue. ∗ to The preceding formula is thus equivalent in Tad ¬(αp ∧ (∃¯ x1 αc1 ∧ (∃¯ x2 αc2 ∧

^

¬(∃¯ yi βic ∧ ϕi )))).

i

Let us denote by I1 , the set of the i ∈ I such that x2n has no occurrences in ∃¯ yi1 βic1 . The preceding ∗ formula is equivalent in Tad to 



∃x21 ...∃x2n−1  V  p 1 c1 p yi1 βic1 ))∧ ¬(α ∧ (∃¯ x α ∧ α ∧ ( i∈I1 ¬(∃¯ )). V 2 c2 c1 c1 (∃xn α ∧ i∈I−I1 ¬(∃¯ yi βi ))

(5.14)

∗ to According to the properties 3.1.0.4, 5.2.3.2 and 5.2.3.3, the formula (5.14) is equivalent in Tad





∃x21 ...∃x2n−1 V   yi1 βic1 ))∧)). ¬(αp ∧ (∃¯ x1 α1 ∧ αp ∧ ( i∈I1 ¬(∃¯ (∃x2n αc2 )

(5.15)

∗ |= (∃x2 αc2 ) ↔ αc2 with According to Property 5.2.3.4, there exists αnc2 ∈ A2 such that Tad n n ∗ to αnc2 ∈ A2 . The preceding formula is thus equivalent in Tad

^

¬(αp ∧ (∃¯ x1 αc1 ∧ αp ∧ (∃x21 ...∃x2n−1

¬(∃¯ yi1 βic1 ) ∧ αnc2 ))),

i∈I1

i.e. to ¬(αp ∧ (∃¯ x1 αc1 ∧ αp ∧ (∃x21 ...∃x2n−1 αnc2 ∧

^

¬(∃¯ yi1 βic1 )))).

i∈I1

By repeating the preceding steps (n − 1) time and by denoting by Ik the sets of the i ∈ Ik−1 ∗ to such that x2(n−k+1) has no occurrences in ∃¯ yi1 βic1 , the preceding formula is equivalent in Tad ¬(αp ∧ (∃¯ x1 αc1 ∧ α1c2 ∧ αp ∧

V

i∈In

¬(∃¯ yi1 βic1 ))),

i.e. to ¬(∃¯ x1 αc1 ∧ α1c2 ∧ αp ∧

^

¬(∃¯ yi1 βic1 ∧ αc1 ∧ α1c2 ∧ αp )).

i∈In ∗ . This rule is thus correct in Tad Correctness of the rule 26

"

¬7

∃¯ x αc ∧ αp ∧ ϕ∧ ¬8 (∃¯ yβ c ∧ β p)

#

"

=⇒

¬7 (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬9 (∃¯ y β c1 ∧ β p ))∧ V 1 p c1 c2∗ xy¯β ∧ β ∧ βi ∧ ϕ0 ) i∈I ¬ (∃¯

#

121

∗ Chapter 5. Solving first order constraints in Tad

where ϕ is such that every negation symbol ¬k has k ≥ 6, ϕ0 is obtained from ϕ by replacing all occurrences of ¬k by ¬0 and all propagated-constraint sections by true. Let β 2 be the formula obtained from β c2 by removing the multiple occurrences of typing constraints and for all the variables y which do not occur in an inequation of β c2 we remove all relation numy or ¬numy which are both in β c1 and β c2 . If β 2 is the formula true then I = ∅, otherwise the βic2∗ with i ∈ I are obtained from β 2 as follows: Since β 2 ∈ A2 then it is of the form " V V ( `∈L numz` ) ∧ ( k∈K ¬numvk )∧ V Pn Vn

((

j∈J

i=1 aij xi

< a0j ) ∧

#

m=1 numxm )

,

thus ¬β 2 is of the form  W  W W ( `∈L ¬num z` ) ∨ ( k∈K numvk ) ∨ ( nm=1 ¬numxm )∨ Pn Vn W   j∈J (( i=1 aij xi = a0j 1 ∧ m=1 numxm )∨  Pn Vn

(

i=1 (−aij )xi

< (−a0j )1 ∧

m=1 numxm ))

Each element of this disjunction is a block and represents a formula βic2∗ . Of course we have ∗ |= (¬β 2 ) ↔ W β c2∗ . Tad i i Since we have ¬8 , then according to Definition 5.3.1.3, the formula ∃¯ y β c is equivalent in ∗ c1 c2 c1 1 Tad to a decomposed formula of the form ∃¯ y β ∧ β with ∃¯ y β ∈ A . Let β 2 be the formula c2 c2 obtained from β by removing from β the multiple occurrences of the typing constraints and by removing from β c2 all the relations num y or tree y which are both in β c1 and β c2 for every variable y which has no occurrences in the inequations of β c2 . The left hand side of this rule is ∗ to equivalent in Tad ¬(∃¯ xαc ∧ αp ∧ ϕ ∧ ¬(∃¯ y β p ∧ β c1 ∧ β 2 )). ∗ |= ∃?¯ ∗ |= According to the definition of the set A1 and Property 5.2.1.1, we have Tad y β c1 , thus Tad ∃?¯ y β c1 ∧ β p . According to Property 3.1.0.6 of Chapter 3, the preceding formula is equivalent in ∗ Tad to ¬(∃¯ xαc ∧ αp ∧ ϕ ∧ ¬(∃¯ y β p ∧ β c1 )) ∨ ¬(∃¯ xy¯β p ∧ β c1 ∧ ¬β 2 ∧ ϕ). ∗ to a disjunction of According to the conditions of this rule, the formula ¬β 2 is equivalent in Tad W ∗ to the form i∈I βic2∗ . The preceding formula is thus equivalent in Tad

¬(∃¯ xαc ∧ αp ∧ ϕ ∧ ¬(∃¯ y β p ∧ β c1 )) ∧

^

¬(∃¯ xy¯β p ∧ β c1 ∧ βic2∗ ∧ ϕ).

i∈I ∗ . Thus this rule is correct in Tad Correctness of the rule 27

¬7 (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬9 (∃εtrue ∧ β p )) =⇒ true. According to the properties of ¬9 in Definition 5.3.1.3, the formula β p is the formula αc ∧ αp . ∗ . This rule is thus correct in Tad Correctness of the rule 28  7  ∃¯ x αc ∧ αp ∧ ϕ∧    ¬ (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬8 (∃¯ y β c ∧ β p ))∧ c p  ^ ∃¯ yβ ∧β ∧  =⇒   ¬7  ¬6 (∃¯ xy¯z¯i δic ∧ δip ∧ ϕ0 )  ¬8  ^ 9  ¬ (∃¯ zi γic ∧ γip )  



i∈I

122

i∈I

∗ 5.3. Solving first order constraints in Tad

with I 6= ∅, ϕ is such that every negation symbol ¬k has k ≥ 6, ϕ0 is obtained from ϕ by replacing all occurrences of ¬k by ¬0 and all propagated-constraint sections by true. The formula δip = αp , δic = γic ∧ β c ∧ αc . According to the properties of ¬8 and ¬9 in Definition 5.3.1.3, we have β p = αc ∧ αp and ∗ to γ p = αc ∧ αp ∧ β c . The left hand side of this rule is equivalent in Tad ¬(∃¯ xαc ∧ αp ∧ ϕ ∧ ¬(∃¯ yβ c ∧

^

¬(∃¯ zi γic ))).

(5.16)

i∈I

According to the properties of ¬9 and the definition of the set A1 , all the variables of y¯ are ∗ |= ∃?¯ reachable in ∃¯ y β c . Thus, according to Property 5.2.1.1, we get Tad y β c . According to ∗ Corollary 3.1.0.6 defined in Chapter 3, the formula (5.16) is equivalent in Tad to ¬((∃¯ xαc ∧ αp ∧ ϕ ∧ ¬(∃¯ y β c )) ∨

_

(∃¯ xy¯z¯i γic ∧ β c ∧ αc ∧ αp ∧ ϕ)),

i∈I

i.e. to ¬(∃¯ xαc ∧ αp ∧ ϕ ∧ ¬(∃¯ y β c ∧ αc ∧ αp )) ∧

V

i∈I

¬(∃¯ xy¯z¯i γic ∧ β c ∧ αc ∧ αp ∧ ϕ).

Since β p = αc ∧ αp , δip = αp and δic = γic ∧ β c ∧ αc then the preceding formula is equivalent in ∗ to Tad ^ ¬7 (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬8 (∃¯ y β c ∧ β p )) ∧ ¬6 (∃¯ xy¯z¯i δic ∧ δip ∧ ϕ0 ). i∈I ∗ . Thus this rule is correct in Tad Proof third part: Let us show that every finite application of the rules on an initial working formula produces a final working formula. Let ϕ be an initial working formula of the form V ¬6 (∃ε true ∧ i∈I ϕi ), where all the negations of the ϕi are of the form ¬0 . The only rule which can be applied is the rule 24, which starts the solving process by a top-down simplification and propagation of constraints. It is the rules 1...24 which will be used in these steps. At the end, all the sub-working formulas contain negations of the form ¬7 . The rule 25

"

¬7

∃¯ x αc ∧ αp ∧ V 9 y βc ∧ βp) i i i∈I ¬ (∃¯ i

#

"

=⇒ ¬8

∃¯ x1 αc1 ∧ αc2∗ ∧ αp ∧ V 9 y β c ∧ β p∗ ) i i i∈I 0 ¬ (∃¯ i

#

with I = ∅ can now be applied on the most nested sub-working formulas and changes the negations from ¬7 into ¬8 , then the rule 26, "

¬7

∃¯ x αc ∧ αp ∧ ϕ∧ ¬8 (∃¯ yβ c ∧ β p)

#

"

=⇒

¬7 (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬9 (∃¯ y β c1 ∧ β p ))∧ V 1 p c1 c2∗ xy¯β ∧ β ∧ βi ∧ ϕ0 ) i∈I ¬ (∃¯

#

can be applied and changes every sequence of the form ¬7 ¬8 into a sequence of the form ¬7 ¬9 . This rule creates also a conjunction of working formulas each one containing negations of the form ¬1 , on which the first steps will be applied again. When a sequence ¬7 ¬9 is obtained, then the rule 27 ¬7 (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬9 (∃εtrue ∧ β p )) =⇒ true or the rule 25 can be applied and changes the internal negations from ¬7 ¬8 to ¬8 ¬9 . When we have only sequences of the form ¬7 ¬8 ¬9 we can decrease the depth of the working formula from 3 to 2 by applying the rule 28  7  ∃¯ x αc ∧ αp ∧ ϕ∧    ¬ (∃¯ x αc ∧ αp ∧ ϕ ∧ ¬8 (∃¯ y β c ∧ β p ))∧ c p  ^ ∃¯ yβ ∧β ∧  =⇒   ¬7  ¬6 (∃¯ xy¯z¯i δic ∧ δip ∧ ϕ0 )   ¬8  ^ 9 ¬ (∃¯ zi γic ∧ γip )  



i∈I

i∈I

123

∗ Chapter 5. Solving first order constraints in Tad

All these steps are repeated until reaching the following formula ¬7 (∃ε true ∧

^

¬8 (∃¯ xi αic ∧ αip ∧

i∈I

^

p c ¬9 (∃¯ yij βij ∧ βij ))),

j∈Ji

which is a final working formula.

5.3.4

The algorithm of resolution

∗ proceeds as follows: Solving a general constraint ϕ in Tad

1. Transform ϕ into a normalized formula, then into an initial working formula φ, which is ∗ . equivalent to ϕ in Tad 2. Transform φ into a final working formula ψ using the rewriting rules defined in the subsection 5.3.3. ∗ . If the 3. Extract from ψ the disjunction of general solved formulas, equivalent to ψ in Tad disjunction contains the general solved formula true, then it is reduced to true.

Example 5.3.4.1 Let ϕ be the following constraint having i, j as free variables: ∃x x = f ij ∧ i > 0 ∧ ¬numx ∧ numi ∧ numj ∧ ¬(∃k j = 2k ∧ numk). ∗ since for every variable j, We can see that numj ∧ ¬(∃k j = 2k ∧ numk) is always false in Tad there exists a unique variable k such that j = 2k (axiom 13n ). Let us transform ϕ into an initial working formula (the propagated-constraint sections are underlined):

¬6 ¬0 (∃x x = f ij ∧ i > 0 ∧ ¬numx ∧ numj ∧ true ∧ ¬0 (∃k j = 2k ∧ numk ∧ true)) After having applied the rules 24, 15, 16, 15, 19, 21, 22, 23 in this order, we obtain ¬7 ¬6 (∃x x = f ij ∧ i > 0 ∧ ¬numx ∧ numi ∧ numj ∧ true ∧ ¬0 (∃k j = 2k ∧ numk ∧ true)) The rule 24 can now be applied, we get " 7 7

¬ ¬

i > 0 ∧ numi ∧ numj ∧ true∧ ¬1 (∃xk x = f ij ∧ j = 2k ∧ numk ∧ ¬numx ∧ i > 0 ∧ numi ∧ numj)

#

After having applied on the sub-working formula ¬1 (...) the rules 15, 19, 21, 12, 22, 23 the preceding formula is equivalent to "

¬7 ¬7

i > 0 ∧ numi ∧ numj ∧ true∧ ¬6 (∃xk x = f ij ∧ j − 2k = 0 ∧ numk ∧ ¬numx ∧ i > 0 ∧ numi ∧ numj)

#

The rule 24 can be applied. We get ¬7 ¬7 (i > 0 ∧ numi ∧ numj ∧ true ∧ ¬7 (true ∧ i > 0 ∧ numi ∧ numj)) The rules 25, 26 are applied in this order and we obtain ¬7 ¬7 (i > 0 ∧ numi ∧ numj ∧ true ∧ ¬9 (true ∧ i > 0 ∧ numi ∧ numj)) Finally, by application of the rule 27, we get the final working formula ¬7 true, which is equivalent to the empty disjunction of general solved formulas, i.e. false. 124

∗ 5.3. Solving first order constraints in Tad ∗ has at least one model and according to properties 5.3.3.1, 5.3.1.5 and 5.3.1.7, we Since Tad get the following corollary ∗ , either to true, or to false, or to a disCorollary 5.3.4.2 Each formula is equivalent in Tad junction of general solved formulas having at least one free variable and being equivalent neither ∗ . to true nor to false in Tad

125

∗ Chapter 5. Solving first order constraints in Tad

126

Chapter 6

Conclusion We have presented in this thesis new classes of theories and given for each one a decision procedure. We have also presented an automatic way to combine any first order theory T with the theory of finite or infinite and have shown that if T is flexible than T ∗ is complete. We have ended this thesis by a general algorithm solving any first order constraint in a combination of trees and rational numbers. S. Vorobyov [41] have shown that the problem of deciding if a proposition is true or not in the theory of finite or infinite trees is non-elementary, i.e. the complexity of all algorithms solving propositions is not bounded by a tower of powers of 20 s (top down evaluation) with a fixed height. A. Colmerauer and T. Dao [7] have also given a proof of non-elementary complexity of solving constraints in this theory. As a consequence, the complexity of our algorithm and the size of our solved formulas are of this order. We can show easily that the size of our solved formulas is bounded above by a top down tower of powers of 20 s, whose height is the maximal depth of nested negations in the initial formula. The function α(ϕ) used to show the termination of our rules illustrates this result. However, the general algorithm of Chapter 5 is reduced to the algorithm of [16] if the initial formula contains only tree constraints well typed. In this case, we will get without any doubts the same performances than those of [16], i.e. solving formulas having until 160 nested alternated quantifiers (∃∀). On the other hand, the constraints expressing k-winning positions in [16, 7] can be expressed in a much more easy way in an extension into trees of positive integer numbers. In fact, while the integer a is expressed in [16] by the tree 25 f a (0), this integer will be expressed directly using the term a in the extension into trees of positive integer numbers. This simplification will probably enable us to get better performances in terms of time-execution and maximal depth of solved formulas comparing with those of [16]. Currently, we try to find a more abstract characterization and/or a model theoretic characterization of the decomposable theories. The actual definition gives only algorithmic insight into what it means for a theory to be complete. We expect to add new vectorial quantifiers in Ψ(u) the decomposition such as ∃n which means there exists n and ∃n,∞ which means there exists n or infinite, in order to increase the size of the set of decomposable theories and may be get an abstract definition much more simple than the one defined in this thesis. Another interesting challenge is to find which special quantifiers must be added to the decomposable theories to get an equivalence between complete theory and decomposable theory. A first attempt on this Ψ(u) subject is actually in progress using the quantifiers ∃n and ∃n,∞ . It would be also interesting to show if these new quantifiers are enough to prove that every theory which accepts elimination of quantifiers is decomposable. 25

Of course f 0 (x) = x and f a+1 (x) = f (f a (x))

127

Chapter 6. Conclusion We have also established a long list of infinite and zero-infinite decomposable theories. We can cite for example: theory of finite trees, theory of infinite trees, theory of finite or infinite trees [19], theory of additive rational or real numbers with addition and subtraction, theory of linear dense order without endpoints, theory of ordered additive rational or real numbers with addition, subtraction and a linear dense order relation without endpoints, combination of tress and ordered additive rational numbers [24], construction of trees on an ordered set [23], extension of trees by first-order theories [20]. Currently, we are showing the decomposability of other fundamental theories such as: theory of lists using a combination of particular trees, theory of queues as it has done in [39], and the combination of trees and real numbers together with addition, subtraction, multiplication and a linear dense order relation without endpoints. We try also to find some formal methods to get easily the sets ψ(u), A0 , A00 and A000 for any decomposable theory T . Our initial aim in this thesis was to give axiomatizations of complex theories around trees and show their completeness. We have made better by introducing the term extension into trees of theories and by giving conditions on T and only on T so that the theory T +trees is complete. We have also shown the completeness of a theory built on the model of Prolog III, which was unproved before. In order to extend this theoretical work, we plan with Thom Fruehwirth [27] to add to CHR a general mechanism to treat our normalized formulas. This will enable us to implement quickly and easily our algorithms and get a general idea on the expressiveness of first order constraints in complete theories around trees.

128

Bibliography [1] Benhamou, F., Colmerauer, A., Garetta, H., Pasero, R. et Van-Caneghem, M. 1996. Le manuel de Prolog IV. PrologIA, Marseille, France. [2] Burckert, H. 1988. Solving disequations in equational theories. In Proceeding of the 9th Conference on Automated Deduction, LNCS 310, pp. 517–526, Springer-Verlag. [3] Clark, K.L. 1978. Negation as failure. Logic and Data bases. Ed Gallaire, H. and Minker, J. Plenum Pub. [4] Colmerauer, A. 1982. Prolog and infinite trees. In K.L. Clark and S-A. Tarnlund, editors, Logic Programming. Academic Press. pp. 231–251. [5] Colmerauer, A. 1984. Equations and inequations on finite and infinite trees. In Proceeding of the International conference of the fifth generation of computer systems, pp. 85–99. [6] Colmerauer, A. 1990. An introduction to Prolog III. Communication of the ACM, 33(7):68– 90. [7] Colmerauer, A. and Dao, T. 2003. Expressiveness of full first-order formulas in the algebra of finite or infinite trees, Constraints, 8(3): 283–302. [8] Comon, H. 1988. Unification et disunification : Théorie et applications. Thèse d’informatique. Institut National Polytechnique de Grenoble. [9] Comon, H. and Lescanne, P. 1989. Equational problems and disunification. Journal of Symbolic Computation, 7: 371–425. [10] Comon, H. 1991. Disunification: a survey. In J.L. Lassez and G. Plotkin, editors, Computational Logic: Essays in Honor of Alan Robinson. MIT Press. [11] Comon, H. 1991. Résolution de contraintes dans des algèbres de termes. Rapport d’Habilitation, université de Paris Sud. [12] Courcelle, B. 1983. Fundamental Properties of Infinite Trees, Theoretical Computer Science, 25(2):95–169. [13] Courcelle, B. 1986. Equivalences and Transformations of Regular Systems applications to Program Schemes and Grammars, Theoretical Computer Science, 42: 100–122. [14] Dao, T. and Djelloul, K. 2006. Solving first order constraints in evaluated trees. In Proceedings of the 11th ERCIM Workshop on Constraint Solving and Constraint Logic Programming (CSCLP’06) (to appear) 129

Bibliography [15] Dao, T. et Djelloul, K. 2006. Résolution de contraintes du premier ordre dans la théorie des arbres évalués. Dans les actes de la deuxième journée francophone de programmation par contraintes (JFPC’06). (to appear) [16] Dao, T. 2000. Résolution de contraintes du premier ordre dans la théorie des arbres finis ou infinis. Thèse d’informatique, université de la Méditerranée, France. [17] Dao, T. and Djelloul, K. 2006. Solving first order constraints in evaluated trees. International conference on logic programming (ICLP’06). (Poster) [18] Djelloul, K. 2006. Decomposable theories. Journal of Theory and Practice of Logic Programming (TPLP). Cambridge journals. (to appear) [19] Djelloul, K. and Dao, T. 2006. Solving First-Order constraints in the Theory of Finite or Infinite Trees : Introduction to the Decomposable Theories. In Proceedings of the 21st ACM Symposium on Applied Computing (SAC’06). ACM press (to appear). [20] Djelloul, K. and Dao, T. 2006. Complete first-order axiomatization of the M-extended trees. In Proceeding of the 20th Workshop on (constraints) Logic Programming (WLP’06). INFSYS Research Report 1843-06-02, pp. 111–119. [21] Djelloul, K. et Dao, T. 2006. Extension en arbres de théories du premier ordre. Dans les actes de la deuxième journée francophone de programmation par contraintes (JFPC’06). (to appear) [22] Djelloul, K. 2006. Résolution de contraintes du premier ordre dans des théories dites décomposables. Article long dans les actes du septième congres de la société française de recherche opérationnelle et d’aide à la décision (ROADEF’06). Presses universitaires de Valenciennes, pp 355–368. [23] Djelloul, K. 2005. Complete first-order axiomatisation of the construction of trees on an ordered set. In Proceedings of the 2005 International Conference on Foundations of Computer Science (FCS’05), CSREA Press, pp. 87–93. [24] Djelloul, K. 2005. About the combination of trees and rational numbers in a complete first-order theory. In Proceeding of the 5th International conference on frontiers of combining systems (FroCoS’05), Springer Lecture Notes in Artificial Intelligence, vol 3717, pp. 106–122. [25] Djelloul, K. 2005. Les arbres aux feuilles ordonnées: une théorie complète pour la représentation des connaissances. Dans les actes de la 7ème rencontres nationales des jeunes chercheurs en intelligence artificielle (RJCIA’05). AFIA - Presses de Grenoble, pp. 267–280. [26] Djelloul, K. 2003. Intégration des rationnels additifs et des arbres constructibles dans une théorie complète du premier ordre. Mémoire de DEA. Université de la Méditerranée, France. [27] Fruehwirth, T. and Abdelnnadher, S. Essentials of constraints programming. Springer Cognitive technologies. [28] Huet, G. 1976. Résolution d’équations dans les langages d’ordre 1, 2,. . . ω. Thèse d’Etat, Université Paris 7. France. [29] Jaffar, J. 1984. Efficient unification over infinite terms. New Generation Computing, 2(3): 207–219. 130

[30] John, E. and Ullman, D. 1979. Introduction to automata theory, languages and computation. Addison-Wesley publishing company. [31] Kunen, K. 1987. Negation in logic programming. Journal of Logic Programming, 4: 289–308. [32] Lyndon, R.C. 1964. Notes on logic. Van Nostrand Mathematical studies. [33] Maher, M. 1988. Complete axiomatization of the algebra of finite, rational and infinite trees. Technical report, IBM - T.J.Watson Research Center. [34] Malcev, A. 1971. Axiomatizable classes of locally free algebras of various types. In B.Wells III, editor, The Metamathematics of Algebraic Systems. Anatolii Ivanovic Malcev. Collected Papers: 1936-1967, volume 66, chapter 23, pp. 262–281. [35] Matelli, A. and Montanari, U. 1982. An efficient unification algorithm. ACM Trans. on Languages and Systems, 4(2): 258–282. [36] Paterson, M. and Wegman, N. 1978. Linear unification. Journal of Computer and Systems Science, 16:158–167. [37] Ramachandran, V. and Van Hentenryck, P. 1993. Incremental algorithms for formule solving and entailment over rational trees. Proceeding of the 13th Conference Foundations of Software Technology and Theoretical Computer Science, LNCS volume 761, pp. 205–217. [38] Robinson, J.A. 1965. A machine-oriented logic based on the resolution principle. JACM, 12(1):23–41. [39] Rybina, T. and Voronkov, A. 2001. A decision procedure for term algebras with queues. ACM transaction on computational logic. 2(2): 155-181. [40] Smith, A. 1991. Constraint operations for CLP.de la forme Logic Programming: Proceedings of the 8th International Conference. Paris. pp. 760–774. [41] Vorobyov, S. 1996. An Improved Lower Bound for the Elementary Theories of Trees, Proceeding of the 13th International Conference on Automated Deduction (CADE’96). Springer Lecture Notes in Artificial Intelligence, vol 1104, pp. 275– 287.

Bibliography

132

Abstract The goal of this thesis is the study of a harmonious way to combine any first order theory with the theory of finite or infinite trees. For that: First of all, we introduce two classes of theories that we call infinite-decomposable and zeroinfinite-decomposable. We show that these theories are complete and accept a decision procedure which for every proposition gives either true or false. We show also that these classes of theories contain a large number of fundamental theories used in computer science, we can cite for example: the theory of additive rational or real numbers, the theory of the linear dense order without endpoints, the theory of finite or infinite trees, the construction of trees on an ordered set, and a combination of trees and ordered additive rational or real numbers. We give then an automatic way to combine any first order theory T with the theory of finite or infinite trees. A such hybrid theory is called extension into trees of the theory T and is denoted by T ∗ . After having defined the axiomatization of T ∗ using those of T , we define a new class of theories that we call flexible and show that if T is flexible then T ∗ is zero-infinite-decomposable and thus complete. The flexible theories are first order theories having elegant properties which enable us to handle easily first order formulas. We show among other theories that the theory ∗ of Tad of ordered additive rational numbers is flexible and thus that the extension into trees Tad Tad is complete. Finally, we end this thesis by a general algorithm for solving efficiently first order constraints ∗ . The algorithm is given in the form of 28 rewriting rules which transform every formula in Tad ϕ, which can possibly contain free variables, into a disjunction φ of solved formulas equivalent ∗ and such that φ is either the formula true, or the formula false, or a formula having to ϕ in Tad ∗ . Moreover, the at least one free variable and being equivalent neither to true nor to false in Tad solutions of the free variables of φ are expressed in a clear and explicit way in φ. Keywords: Theory of finite or infinite trees, Complete theory, Combination of theories, Solving first order constraints, Rewriting rules.

134