Extended order-generic queries

Extended order-generic queries

ANNALS OF PURE AND APPLIED LOGIC ELSEVIER Annals of Pure and Applied Extended Logic 97 (1999) 85-125 order-generic queries Oleg V. Belegradek”...

3MB Sizes 1 Downloads 73 Views

ANNALS OF PURE AND APPLIED LOGIC ELSEVIER

Annals of Pure and Applied

Extended

Logic

97 (1999)

85-125

order-generic

queries

Oleg V. Belegradek”,’ , Alexei P. Stolboushkinb~ c,2, Michael A. Taitslind.*.3 aDepuriment ‘Fourth

of Muthematics. Kememuo State Uniwrsity. Kemerooo. 650043 Russiu Dwwnsion Sojiwre. 555 Tw?n Dolphin Dr., Suite 500. Redwood City. CA 9406.~. USA ‘UCLA Department of Mathemrrtics, Los Angeles, CA 90095-1555, USA dDcpurtment qf Computer Science, Twr State University, Tuer. 170000 Russiu Communicated

by Ph.G.

Kolaitis

Abstract We consider relational databases organized over an ordered domain with some additional relations - a typical example is the ordered domain of rational numbers together with the operation of addition. In the focus of our study are the first-order (FO) queries that arc invariant under order-preserving “permutations” - such queries are called order-generic. It has recently been discovered that for some domains order-generic FO queries fail to express more than pure order queries. For example, every order-generic FO query over rational nutnbers with + can be rewritten without +. For some other domains, however, this is not the case. We provide very general conditions on the FO theory of the domain that cnsurc the collapse of order-generic extended FO queries to pure order queries over this domain: the Pseu~~o~finite Homogeneity Property and a stronger Isolation Property. We further distinguish one broad class of domains satisfying the Isolation Property, the so-called y~usi-o-rninirv& domains. This class includes all the o-minimal domains, but also the ordered group of integer numbers and the ordered scmigroup of natural numbers, and some other domains. An important difference of this paper from the recent series of related papers is that we generalize all the notions to the case of finitely representable database states ~ as opposed to finite states - and develop a general lifting technique that, essentially, allows us to extend any result of the kind we are interested in, from finite to finitely representable states. We show, however, that these results cannot be transfered to arbitrary infinite states. @ 1999 Elscvier Science B.V. All rights reserved.

* Correspondence address: 62 Mozhaiskogo 7 0822 331274; E-mail: [email protected]

St., apt. 265,

Tver,

170043

Russia.

Tel.:

708222

90761:

fax:

’ A part of this work was done while Oleg Belegradek was visiting the Fields Institute for Research in Mathematical Sciences in Toronto (January-March, 1997). ’ This work of Alex& P. Stolboushkin was partially supported by NSF Grant CCR 9403809. ’ A part of this research was carried out while M.A. Taitslin was visiting LJC1.A (partially supported hy NSF Grant CCR 9403809), DIMACS and Princeton (partially supported by a grant from Princeton University). The work of the author was partially supported by the Russian Foundation of Basic Research (project code: 96-01-00086).

0168.0072/99/$ - see front PII: SO168-0072(98)00025-6

matter

@

1999 Elsevier

Science

B.V.

All nghts

reserved

0. V. Belegradek et al. I Annals

86

AMS

classijcation:

primary 68P15;

of Pure and Applied Logic 97 (1999) 85-125

secondary

03C40, 03C52

Keywords:

Pseudo-finite homogeneity property; Isolation property; Quasi-o-minimal Local generic&y; Finite database state; Finitely representable database state

structure;

1. Introduction 1.1. Injinite

domains

In the relational model of databases introduced by E.F. Codd a database state is thought of as a finite collection of relations between elements. For example, a fatherson relation can be represented in the form of one binary relation (or a two-column table). The names of the relations and their arities are fixed and are called a database scheme. Particular information stored in the relations of a given scheme is called a

database state. As we acquire more and more information about fathers and sons, the database states change, but the scheme (one binary relation) does not. Database relations (tables) are always going to be finite. However, it is often convenient to assume that there is an infinite domain - for example, the integer or rational numbers or the strings - such that the data elements are chosen from this domain. Functions and relations defined over the entire domain, like < and +, may also be used in querying, for example, if the language of first-order logic FO is used as the query language, its formulas may use database relations as well as the domain relations, while variables range over the entire domain. A study of databases over domains equipped with an additional structure (‘constraint databases’) and the expressive power of the corresponding Kanellakis

query languages

(‘constraint

query languages’)

was started by

et al. [15, 161.

1.2. Finitely

representable

The database

relations

relations are finite, but answers

yielded

by relational

queries may or

may not be finite. This makes the traditional relational model not closed, in the sense that the output of queries is of a different nature than the input. Kanellakis et al. [ 15, 161 considered the real ordered fields and groups as domains and observed that, since the first-order theories of these admit elimination of quantifiers, the answers to first-order queries can be represented as quantifier-free first-order formulas, and then, if we allow database relations to be arbitrary relations representable by quantifier-free first-order formulas to begin with, the so modified relational model becomes closed in the above sense. The quantifier-free definable relations are called finitely representable (for short, fr.); the term is due to [9]. Finitely representable databases are a logical choice, because finitely representable relations appear as results of queries dealing with finite relations anyway, and it is also

0. V Belegradek et ul. I Annals of’ Pure and Applied Logic, 97 (1999)

a natural

choice in many applications,

spatial databases

The original

databases

(cf. [ 15. 161) or

[ 191.

1.3. Ordered domains

finite database

say, in geographical

81

85-125

notion

and generic querie.5 of generic

query

[6] ’ referred

to the =-generic

queries

states, that is, the queries (over finite states) which are preserved

arbitrary permutations of the domain. properties, are indeed =-generic.

Some practically

interesting

queries,

over under

say, graph

The expressive power of the pure FO with respect to generic queries is, however, severely limited - a classical example is the inexpressibility of the parity query asserting that the cardinality of a finite relation in the database scheme is even. One of the ways to try to enhance the expressive power of the query language is to allow domuin ,fimctions,Jrelations, or givens to be used in the queries, as we mentioned above. The simplest example is the relation < of linear order. Throwing in such givens obviously increases the expressive power of FO, but what is often not obvious is whether any new generic queries become expressible. Yu. Gurevich [12] showed that there are =-generic queries that are FO expressible over finite states with <, but not without. Here is a version of his example. Let K be the class of all finite Boolean algebras with an even number of atoms. This class cannot be axiomatized within the class of finite structures by a first-order sentence because if it were then, by compactness, there would exist infinite atomic Boolean algebras B and B’ such that the sentence would hold in B but fail in B’, in contradiction to the completeness of the theory of infinite atomic Boolean algebras (set e.g. [7]). However, KC, the class of expansions of the algebras in K by linear orders, is axiomatizable

in the class of finite structures

by a first-order

sentence

$ which is the

conjunction of the axioms for Boolean algebras, the linear order axioms, and a sentence expressing that there is an element containing exactly the atoms at even positions (in the ordering

induced

on the atoms) and containing

any infinite ordered universe

the last atom. It follows that, over

U, the FO query corresponding

to $ is not equivalent

to

a pure FO query for finite states, even though it is =-generic. Now consider

the ordered set of rational

numbers.

Since its first-order

theory admits

quantifier elimination, any FO query defines a mapping that maps every finitely representable database state into a new finitely representable relation. Since any finite partial <-isomorphism of the rationals can be extended to an <-automorphism, this mapping is invariant under finite partial order isomorphisms. In this sense, all the queries over finitely represented states over the rationals that can be expressed in the first-order language FO are locall~~ <-generic. There are some rather simple locally <-generic queries, however, that are not FOexpressible. For example, the Boolean query that says that the cardinality of a finite set - a unary relation - is even, is not expressible in FO. More examples can be found ’ [6] used a different term for this nobon

88

0. K Belegradek et al. I Annals of Pure and Applied Logic 97 (1999)

in [14-161. The problem

we are interested

of FO, while preserving

local <-genericity.

Note that although

the language

in is to try to increase the expressive

FO( < ) of first-order

order does indeed express more =-generic to be inexpressible.

Naturally,

85-125

logic with a relation

power

of linear

queries than the pure FO, parity continues

we may ask whether, over a certain ordered domain, it is

possible to express even more =-generic

queries using extended signatures.

We observe

that, with each =-generic query being locally <-generic, the collapse results like the ones established in this paper are automatically transferred to the case of =-genericity. Over rational numbers, the FO queries that only use < were shown to have the uniform data complexity AC0 [14]. Attempts to distinguish the resulting extended queries from order queries in this domain using specific combinatorial or spatial queries not in AC0 - like parity, Eulerian traversal, or region connectivity - have been unsuccessful, and, finally [ 10, 1 l] proved the AC0 uniform data complexity for the extended queries over finitely representable inputs with integer constants only. However, the question of whether or not extended queries are more expressive than order queries, has remained open, and as Grumbach and Su [9] pointed out, “. . . there is a serious lack of proof techniques., .” in this area. In Section 3 (Theorem 3.2) we show that, if all possible states were considered, no translation would be possible even in such a simple example as the additive group of rational numbers. But of course the really interesting cases are those of finite and of finitely representable database states. In Section 4 we show that these two cases can be treated uniformly. One of the main results of the present paper, Theorem 4.9, is that, over every ordered domain, finitely representable states can be uniformly represented as finite states of another database scheme, with the additional property that these finite database states are FO expressible (in the restricted language) in the old database scheme, and vice versa. This technique, in effect, allows us to lift any result on translatability

jnitely

of extended

queries into restricted

representable states. The recursiveness

queries over jinite database states, to the of translation is preserved as well. This

result first appeared in [27]. This technique can also be used to expand applicability of several other results for finite database states to the case of finitely representable states.

1.4. Collapse results Paradaens et al. [20] considered real numbers with +, and showed that, over finite database states, locally < -generic extended queries can be recursively 2 translated into restricted (pure order) queries. Due to our lifting result, the same is automatically true for all finitely representable states. In [27], Stolboushkin and Taitslin proved a more general result on recursive translation of locally <-generic extended into restricted FO queries over an arbitrary ordered *Although

the algorithm

is not explicit in their paper.

0. I/. Belegradek et al. I Annals of‘ Pure and Applied Logic 97 jl%‘Si

divisible

Abelian

role of addition breakthrough extended

group, thus answering, in databases

queries to restricted

in [ 17, 21, 221. Examples

At around the same time, in their the collapse

of locally

for a broad class of domains

domains. 3 Their proof uses non-standard troduced

numbers.

et al. established

queries

from [ 10, 1 l] of the

for example, the question

over rational

paper [5], Benedikt

analysis.

of o-minimal

89

85-125

<-generic

called o-minimal

The notion of o-minimality structures

include

was in-

real numbers

with

+, x, exponentiation and <, as well as many other structures. Since every ordered divisible Abelian group is o-minimal, this, in one sense, covers the results of [20, 271. Notice, however, that, in another sense, the results are of a different nature. First, the proof in [5] is not constructive and does not give an algorithm for translation. Further, this proof cannot be made constructive. Indeed, take an o-minimal structure whose first-order theory is undecidable, while the first-order theory of < alone is decidable, for example, the structure (R, +, x, < ,c), where c is a non-computable real number. If a recursive

translation

existed, this would lead to a contradiction.

In this paper, we suggest an approach that gives even stronger non-effective collapse results. The approach is based on the observation that expressibility of a locally <-generic extended query over finite states over a universe as a restricted query is a property of the complete first-order theory of the universe rather than the universe itself. Therefore we can use the well-known model-theoretic technique of saturated models to study this property of the theory of the universe. First, in Theorem 5.1, we give a necessary and sufficient condition for an extended query to be equivalent to a restricted query. In essence, this is a new definability theorem. Secondly, in Theorem 5.2, this technique is further refined for locally <-generic queries. Thirdly, we formulate a very general condition on the domain - the so-called Psedo,finite Homogeneity Property - that ensures collapse of locally <-generic FO queries over this domain to pure order queries (see Theorem 5.4). However, proving the Pseudo-finite Homogeneity Property for a specific domain may be a bit technical. We introduce

a condition

on the domain,

the Isolation

Property,

which

ensures

the

Pseudo-finite Homogeneity Property (Theorem 5.8). Fourthly, we identify a broad class of domains - the so-called quasi-o-minimal domains - which all satisfy the Isolation Property (Theorem 5.12). Examples of quasi o-minimal domains include the following: all o-minimal domains; the integer or natural numbers with +. < ; the ordered set of real numbers with the distinguished subset of rational numbers; and ordered unions of o-minimal

’ Again, they considered technique in this paper.

domains.

finite states only, but this can be lifted to finitely representable

states using the

90

0. K Beleyradek

The Isolation

Property

et al. I Annals of Pure and Applied Logic 97 (1999)

is broader than quasi-o-minimality:

ture of the form (A, < ,E), is an equivalence

relation

where

85-125

for example,

< is a dense linear ordering

every struc-

on the set A, and E

on A with two dense classes, satisfies the Isolation

Property

but is not quasi-o-minimal. The Pseudo-finite

Homogeneity

Property

is broader than the Isolation

prove that for the structure (iw, +, <, Q) the Pseudo-finite

Homogeneity

Property:

we

Property holds

but the Isolation Property fails. Still, over this structure, every locally <-generic extended query over finite states is equivalent to a restricted query. This immediately implies the analogous collapse result for any structure of the form (A, <, E), where (A, <) is a dense linearly ordered set without endpoints, and E is an equivalence relation on A with infinitely many classes all of which are dense. Further, due to the Pseudo-finite

Homogeneity

Property,

the collapse result holds for

any structure of the form ([w, f, <, F,f,)rEp, where F is a subfield of iw, and ,fx is a name for the unary operation of multiplication by the scalar a. However, it is easy to see that for the structure ([w, f, x, <, CD) the collapse result fails. This indicates that our collapse results are edging toward the limit. The starting point of our work on generic collapse for finite states was an attempt to ‘standardize’ the proof in [5], in other words, to find a proof which does not use a non-standard analysis. It turns out, however, that some of the ideas of that paper work in a much broader context. Thus, our results cover the previously known, and several new, cases. Yet the proofs are relatively compact and straightforward. These results are presented in Section 5. Note that some of the notions and the technique we introduce turned out to be interesting in its own right, from the model-theoretic point of view (see [2, 81). Recently, after acceptance of our paper for publication, a very interesting paper of Baldwin and Benedikt [I] appeared, where they showed that the expressive power of the extended query language over finite states over an infinite domain is determined by stability-theoretic properties of the domain. In particular, they proved the collapse result for locally generic queries over ordered domains without the independence property. This covers our collapse result for quasi-o-minimal domains. However, it is not clear whether every theory with the Pseudo-finite Homogeneity Property does not have the independence property. A draft version of this paper was published as [3]. A short abstract covering of the results in this paper was presented in [4].

some

2. Preliminaries A structure of a relational signature L is a non-empty set with a mapping that assigns to every relational symbol in L a relation of the same arity over the set. Let U be an infinite structure over the signature L. This structure is called the universe. In this paper, we always consider ordered universes. This means that L includes a binary relational symbol < whose interpretation in U satisfies the axioms of linear order. Let us denote Lo = { < }. A database scheme SC is a finite collection of relational symbols of fixed

!I1

0. K Beleyradek et al. I Annals qf Purr and Applied Logic, 97 i 1999) 85-125

arities.

A database

concrete relations wlations.

state

(over

of corresponding

U) is an assignment

to these relational

arities over U. These relations

are finite.

scheme SC and denote LT = LO U SC, and L t = L U SC.

Let N, Z, U2, and 52 be the sets of all natural, respectively.

of

are called databuse

A database state is called a.finite database state if all the relations

We fix a database

symbols

Practically,

the most interesting

integer,

rational,

cases of universes

and real numbers,

are:

(a, <,+) and (R, <,+), l (Z <.+) and (N, <.+>, l (R <,+,x). The set of all elements of the universe that occur in some tuple in some relation of a database state s is called the active domain of s; we denote it by AD(s). We denote AD(X) a first-order formula of signature SC which says that .Y is an element of the l

active domain. For a subset X of the universe U, a database a database state over X iff AD(s) is a subset of X.

state s over CJ is called

For convenience, we will consider database schemes that contain not only relation symbols, but also finitely many constant symbols. A database state over a universe U for such a scheme is a mapping that assigns to any relation symbol in the scheme a relation on IJ of the corresponding arity, and to any constant symbol in the scheme element in U. In this case the active domain of a database state is defined to be union of the active domain of the relational part of the state and the set of values all constants of the scheme. For a relational database scheme SC, denote by SC,

an the of the

scheme SC IJ {cl,. , CL}, where the c, are new constant symbols. A dutabase query’ can formally be defined as a mapping that takes in a database state (of a fixed database scheme), and produces a new relation, of a fixed arity, over L’. Thus. every query has an arity. Specifically, queries of arity 0 are called Boolean queries. A Boolean query defines a mapping from database states to (0. 1 }. or, in other words. a set of database states of a given database scheme. Queries can be formulated using query languages, the simplest being the language of first-order logic FO. Formulas (queries) of this language use =, as well as the relational symbols of the signature and of the database scheme. Thus, a database state essentially defines a structure of a larger signature with U as the domain; then a formula with II free variables defines an n-ary relation over U; sentences define Boolean queries. We say that two L+-formulas with n free variables are equivalent over finite states over U if they define the same n-ary query. Clearly, two L--formulas @(xl,. . ,_q ) and $(.x1,. ,xk) are equivalent over finite states over a universe U if and only if the sentences &cl,. , CL) and I/J(~, , . c’~) of signature L U SCk are equivalent over finite states over U. A relation on U is said to be,finitelv representable if it can be defined by a quantificrfree formula using =. <, and constants for the elements of U. Such a formula is called a,finite representation of the relation; if each element whose name occurs in the formula belongs to a set X the formula is called a jinite representation over X. A database state is said to be finitely representable if every relation corresponding to a relation name from SC is finitely representable.

92

0. V. Belegradek

We consider of the signature formulas

et al. IAnnals

two languages

for querying.

Queries

85-125

of the first one are FO formulas

L,f - we call them restricted. Queries of the second language

of the signature

under order-preserving

an automorphism

are FO

L+ - we call them extended. queries

are generic, in the sense that they are

permutations

of U. In other words, if f: U + U is

It is easy to see that the restricted preserved

of Pure and Applied Logic 97 (1999)

of (U, < ), and a restricted

query Q maps a database

state s to a

relation R, then Q maps f(s) to f(R); in other words, Q(f (s)) = f (Q(s)). Extended queries may not be generic. Here for any state s over U, we define ,f(s) as a state over U such that for any R of SC and any 2 E U, ((f (s))(R))(f

(a))

8

(s(R))(a)

where f(al,...,a,)=(f(al),...,f(a,)). More generally, let M be an L-structure, and K be a class of states over M. We call an L-formula 4(X) generic over the states from K if, for any state s from K, any tuple Z in M, and any Lo-automorphism f of the structure M, &ii) holds in (M,s) 4( f (ii)) holds in (M, f(s)), in symbols, (Ns)

t= 4G)

iff (Mf(s))

iff

I= 4(f(4).

We will also use a stronger notion of locally generic query. It was proposed in [5]. A k-ary query Q is said to be locally generic over finite states if ii E Q(s) iff f (ii) E Q( f (s)), for any partial < -isomorphism f: X 4 over X, and for any k-tuple ii in X. For any finite representation 0 over a subset X < -isomorphism f: X --+U, a finite representation defined, by replacing any parameter II that occur

U with X C U, for any finite state s of U of a relation and for any partial f(g) of the relation can be naturally in G with the parameter f(a). So, for

finitely representable states, the notion of local genericity can be defined as follows. A k-ary query Q is said to be locally generic over jinitely representable states if si E Q(o) iff f (ii) E Q( f (o)), for any partial < -isomorphism f: X ----)U with X C U, for any finite representation u over X, and for any k-tuple ii in X. Here we denote by Q(a) the state into which the query Q transforms the state finitely represented by IS. Since a finite n-ary relation {Zi,., .,ii,}, where zii =(ail,. . .,ai,), can be finitely , , xj = aii, every query which is locally generic over represented by the formula Vz, A”= finitely representable states is locally generic over finite states, too. On the other hand, a query which is locally generic even over all states cannot be locally generic over finitely representable states: an example is the Boolean query ‘P # 0’; it is obviously locally generic over all states over 77, but O
0. C’. Belegradek et al. I Annals of Purr and Applied Logic 97 (1999)

for this is the so called double transitioity transitive

of the domain:

if for any a, < bl and a? < b2 in the domain,

of the domain any partial

mapping

,f :X +

of U.) For instance,

while the integer numbers

is called doubly

there exists an < -automorphism

al to a?, and bl to b2. (A proof: if U is doubly

< -isomorphism

automorphism

a domain

‘)!

85-135

U with finite X & U can be extended

the real and rational

numbers

transitive to an < -

are doubly transitive.

are not. The Boolean query ‘there are even and odd numbers

in P’ is an example of a query which is generic but not locally generic over finite states over Z. Moreover, even a restricted query cannot be locally generic: for example, the restricted Boolean query ‘P is convex’ is not locally generic over finite states over Z.

3. Impossibility

of translation

over arbitrary states

The goal of this section is to compare restricted and generic extended queries from the viewpoint of their expressive power over all possible states, whether finitely reprcsentable or not. We show that, in general, extended generic querying is more expressive than restricted, even in very simple situations. In fact, the results in this section be proved, with a little more trouble, for all recursive states.

can

Theorem 3.1. There is an extended Boolean quer)’ Q ocer (Z, +, -Cj, the ordered group qf integer numbers, such that (I) Q is generic oc’er all database states; in particular. Q is generic over all finite states; (2) Q is not equivalent,

otler$nite

database states, to u restricted quer!; in particular,

Q is not equivalent, over all database states. to a restricted query. Proof.

Let Q be the query

‘there are ecen and odd numbers

in P’. The query

Q

is generic over all possible database states. Indeed, the order automorphisms of the integers are exactly the maps of the form x w x + n; clearly, the query Q agrees on P and P + n, for any integer n. Clearly,

there is an extended

FO query that expresses

Q, for all possible

database

states. We show that Q cannot be expressed as a FO restricted query, for finite database states. Towards a contradiction, suppose there exists a first-order sentence cp of the signature L = { <.P} such that an L-structure (Z, <.X) with a finite X satisfies cp iff there are even and odd numbers in X. Let r be the infinite set of L-sentences that assert: l < is a discrete linear order without endpoints: l P has endpoints; l every element of P, which is not maximal in P, has a successor in P: l every element of P, which is not minimal in P, has a predecessor in P: l between any two elements of P there are infinitely many points; l P has infinitely many elements.

94

0. K Belegradek et al. I Annals of Pure and Applied Logic 97 (1999)

Clearly,

85-125

for every finite subset il of l?, both of the sets A, cp and A, lq

of the form (Z, <,X)

with a finite X. Then,

both consistent.

standard

Ehrenfeucht

Using

by compactness,

model-theoretic

arguments

(for example,

game) one can show that the theory I is complete.

Note that Q constructed

is obviously

have models

I’, cp and r, lcp are a Frai’sse-

A contradiction.

not locally generic. Moreover,

0

it will be shown

in Section 5 that every FO extended query, which is locally generic over finite states over (Z, <, +), is equivalent, for finite database states, to an FO restricted query (Theorem 5.12). A similar of rational numbers.

result will be proved

for (Q, <, +),

the ordered

group

By the way, the mentioned result from Section 5 concerning Z has a curious corollary: the query ’ JPI is even’ cannot be expressed as an extended FO query for finite database states over (22, <, +), as opposed to the query ‘there are even and odd numbers in P’. Indeed, the query ‘IPI is even’ is obviously locally generic, even over all database states, and essentially the same arguments, as in the proof of Theorem 3.1, show that the query is not equivalent, for finite database states, to an FO restricted query over (77, <, +). Note, for contrast, that the query ‘lP/ is finite’ can be expressed as a restricted FO query over (Z, <, +), because a set of integers is finite iff it is bounded. It is natural to ask whether Theorem 3.1 holds for Q instead of Z. In this situation, in contrast to the case of (Z, <, +), the notions of genericity and local genericity coincide. However, for (Q, <, +), we will give an example of an extended query which is generic over all database states, but not equivalent, over all database states, to a restricted one. That example draws a line between finite and finitely representable database states, on one side, and essentially infinite states, on the other. In fact, we will prove a more general result: Theorem 3.2. The extended querying is more expressive over all the database states than the restricted one with respect to generic Boolean queries over any divisible Archimedean ordered Abelian group not isomorphic to the ordered group of reals. Classical examples of divisible Archimedean ordered Abelian groups are the ordered groups of rational and real numbers. It is known that, up to isomorphism, Archimedean ordered groups are exactly the subgroups of the ordered group of reals. The following is an example of an uncountable divisible Archimedean ordered Abelian group not isomorphic to the ordered group of reals. Let b be an irrational number. Consider a basis B of R over Q, containing b; clearly B is of power of continuum. Let G be a Q-subspace of IF! generated by B\(b). Then G is a required group. Indeed, clearly it is Archimedean and divisible. The orders on G and R! are not isomorphic: the order on G is not complete as b is not in G. We do not know whether the result of Theorem 3.2 holds for the ordered group of reals.

0.1’. Belegradek et al. I Annals of Pure and Applied Logic 97 11999) X5 12.5

To prove Theorem

3.2, it suffices to prove the following

Theorem 3.3. Let (A, +, <) finiteness

qf’ dutubuse

be an Archimedeun

states over A is expressible

Theorem 3.4. Let A be u set sf’ reals containing states over A is expressible Note, for contrast, query because

by a restricted

that in (Z. <)

a set of integers

ordered

two results. Abeliar!

by un extended

group.

Then the

FO query..

Cl. Then the ,finiteness

of’d~tdu~x~

FO quer)’ $f A = IQ

the finiteness

is expressible

by a restricted

FO

is finite iff it is bounded.

Proof of Theorem 3.3. It is easy to see that a database state over A is finite ifl its active domain is bounded and there is a positive u E A such that u < /.Y- ~1, for any distinct x and y in the active domain. first-order language of ordered groups.

The latter can be obviously C!

expressed

in the

Proof of Theorem 3.4. If A = [w, a database state over A is finite iff its active domain is bounded and has no limit points; the latter is obviously expressible by a restricted FO query. Suppose .4 # R. Then in Q there are a0 < ai <.

and ah > u{

with sup a,, = inf u:,

e ‘4. Towards a contradiction, assume that there is a sentence cp of the signature L= { < . R}. where R is a unary relation symbol, such that, for any X CA, the sentence cp holds in (il. <,X) iff X is finite. Let T be the first-order L-theory that says: < is a dense order without endpoints; l R has a minimal element and a maximal one provided R f @; l each element has a successor in R provided the element is not an upper bound for R; Q each element has a predecessor in R provided the element is not a lower bound for R. l

Let T’ be the theory of all structures of the form (B, <, F), where (B, < ) is a dense ordered set without endpoints and F is a finite subset of B. As the theory of dense ordered

sets without

endpoints

is complete,

T’ is the theory of all structures

of the

form (A, < , F), where F is a finite subset of A. Therefore cp E T’. Clearly. T C T’; we will show that T is an axiom system for T’. Then a contradiction follows because. for X = {a,, ui : i < (a}, the structure (A, <.X) is a model of T. ~cp. We need to show that every model of T with infinite R is a model of T’. As. by compactness. T’ has a model with infinite R, it suffices to show that any two models of T with infinite R are elementarily equivalent. The latter is an easy corollary of the well-known results on the completeness of the following two theories: l To, the theory of infinite orderings with maximal and minimal elements in which every non-maximal element has a successor and every non-minimal element has a predecessor; l TI, the theory of dense orderings without endpoints.

96

0. V. Belegradek et al. IAnnals of Pure and Applied Logic 97 (1999)

85-125

Indeed, it suffices to prove that any two special models of T of the same power /z with infinite R are isomorphic. need, see Section

(For the definition

model of power 2 of To; so its isomorphism completeness

and the properties

of special models we

5). For every such a model M, the ordering

of TO. For any subsequent

type is uniquely

elements

(R”, <) is a special determined,

due to the

a and b in R”, the interval

M is a special model of TI of power 1; so its isomorphism

type is uniquely

(a, 6) in

determined,

due to the completeness of TI . The same is true for the intervals (-co, min(R”)) and (max(R”), co) in M. Since every element of M\RM belongs to one of the intervals of the forms above, the isomorphism done. 0

type of M is uniquely

In the special case when A is countable,

Theorem

determined,

and we are

3.4 admits an especially

simple

proof. If 40 expressed the finiteness of R in (A, <, R) then, by compactness and the Lbwenheim-Skolem theorem, there would be an infinite subset in a countable dense ordered set without endpoints, for which cp holds. As every countable dense ordered set without endpoints is isomorphic to (A, < ), we would have a contradiction with the choice of cp. We conclude the section with some observations concerning translations over all states. There is a connection between the problem of equivalence of generic extended queries over arbitrary states and classical definability results. Theorem 3.5. Let T be an L-theory. Suppose an Li-formula 4(X) is Lo-generic over arbitrary states over any model of T. Then there is a Jinite set of Lof-formulas 4, (X), . . . , #I,,(X) such that T t i/F=, b5 (4(Z) ++ &(Z)). In particular, over any model of T, the formula 4 is equivalent over arbitrary states to an L,f-formula. Here the symbol t- denotes, as usual, the provability The following

We deduce the result from the following 1959 (see

relation for the first-order

logic.

proof works not only for Lo = { < } but for an arbitrary Lo.

[13], Corollary

Svenonius’

definability

theorem proven

in

10.5.3).

Svenonius’ Definability Theorem. Let Lo, L be jirst-order languages with Lo 2 L, and R a relation symbol of L. Let T be an L-theory such that for every model M of T the relation RM is invariant under all Lo-automorphisms of M. Then there is a jinite $I(?), . . . , t,bn(X)such that T t- Vy=, V,? (R(2) H I,QX)).

set of Lo-formulas

Proof of the Theorem 3.5. Let R be a new relation the length of X. Consider the L+(R)-theory

name of arity n + 1, where n is

T’ = T u {My (R(Y, y) ++ 4(X))}. (If 4 is not a sentence, we may let R to be an n-ary relation name and omit the y; however, as in Svenonius’ theorem the arity of R is supposed to be nonzero, we introduce the y when 4 is a sentence.)

‘)I

0. V. Belegradek et al. I Annals of Pure and Applied Logic 97 (19991 85-125

Due to the Lo-genericity T’ the interpretation theorem,

7” t

of 4 over all states over any model of T, in any model of

of R is invariant

there are &J-formulas

under all L;-automorphisms.

$r(X, y),

Then, by Svenonius’

, I),,(?, y) such that

()Y.fy (R(2, y) ++ I,&?, y)).

It follows that

and we are done.

0

In the Theorem 3.5, it is essential that we assume the Lo-genericity of $I over arbitrary states over all models of T: even in the case of complete T it can happen that 4 is Lo-generic and equivalent to an L,‘-formula over one model and is Lo-generic and not equivalent to an Li-formula over another model. Such an example - for the theory of ordered nonzero divisible Abelian groups - is contained in our paper (see Theorems 3.3 and 3.4).

4. Canonical

representation

The goal of this section be treated uniformly. To representable relations can signature, such that these

for finitely representable

is to show that finite and finitely representable states can achieve this goal, we show in Theorem 4.9 that finitely be represented uniformly by finite relations, of a different f.r. states and their finite “codes” can be mapped to each

other by restricted queries. We begin with a simple example. relation Pa on Q:

Consider

the following

To reconstruct PO, it suffices to know: l the set of constants Bo used in the representation and, moreover, l which of the singletons and the open intervals (-x,1),

{l)> (1,2),

relations

{2}, (293)

{3}, (3,4),

finitely

represented

unary

- in our case it is { 1.2,3,4,5},

{4}, (4,5),

(5,~)

are contained in PO. The latter sets can be characterized as minimal open intervals and singletons which can be defined using constants from Ba; we will call them &-minimal l-cells. Clearly, PO is the union of all &-minimal l-cells which are contained in PO.

0. V. Belegradek et al. I Annals of Pure and Applied Logic 97 (1999) 85-125

The set of constants for example,

over which PO can be defined is not uniquely

PO can be represented

determined

by PO;

over the set (0,1,2,3,4,5} by the formula

((0
the constant

0 is obviously

irrelevant

here as it is shadowed

by the second

conjunct. In fact, the constants which are really relevant are just the boundary points of PO. Clearly, there is a unary restricted FO query 6 which, for any subset P of 0~ as an input, yields its boundary as an answer. We show that the information which is contained in the second item can be obtained from PO by means of several FO restricted queries (which can be uniformly applied to any finitely represented subset of 0). Let B be a boundary set of such a P; it is a finite set. There are 5 types of B-minimal 1-cells: (0) a;s;

(1) {b};

(2) (-m,b);

here b, b’ E B, and in all from B. Consider the following relations Si ,& and Ss are 0 So=true iff Q=P; l S,(b) holds iff b E B; l S*(b) holds iff b is the l &(b) holds iff b is the l &(b, b’) holds iff b, 6’ (b, b’). In other words, Sj contains are contained

(3) (b, 00);

the cases except

(4) (kb’);

(1) the l-cells

do not contain

any point

5 relations Sj on B (i <5). The relation SO is 0-ary; unary, and the relation S, is binary. We put

least element of B and P contains (-oo;, b); greatest element of B and P contains (b,oo); are subsequent elements of B, and P contains the information

which of the B-minimal

l-cells

the

the interval of type (i)

in P.

It is easy to write down a restricted FO query gi which, for every finitely represented subset P of Q as an input, yield the finite relation S; as the answer. Clearly, P can be recovered from the finite relations B and S’s by means of a FO query rc, because P is the union of all B-minimal l-cells which are contained in P. So, we have shown that, for any finitely representable subset P of Q, we can find, uniformly in P by means of FO queries, a finite collection of finite relations on Q, from which P can be uniformly recovered by means of a FO query. Our goal is to prove an analogous result for finitely represented relations of arbitrary arity. Here the idea is essentially the same, but some new important points appears. We illustrate this for the case of arity 2. Consider a binary finitely represented relation P on Q. We may assume that P is contained in one of the three relations

{(a,b) : a
{(a,b) : a > b),

{(a,b):

a=b},

0. CI Belegradek et al. I Annals qf Pure and Applied Logic 97 i 1999) 85 ~135

99

because P is the disjoint union of the intersections

of P with these three relations,

the intersections =D.

for example, that P G{(u. b): a
are finitely representable.

It can be proven (it is not obvious!) P can be finitely

represented,

Assume,

that among the finite subsets of Q, over which

there is the least one; we call it the set of boundary

points for P and denote it by t3P. For example, (O
and

if P is the relation

v (1
then ?P = { 0. 1,2}. Moreover,

it turns out that ?P can be obtained

of a FO query, uniformly in P. For a finite subset B of Q, we define a simple binary relation

from P by means

on Q over B to be a

finite union of “rectangulars” defined over B; that is, the simple binary relations over B are those which can be finitely represented by disjunctions of conjunctions of formulas of the forms x = h,

x
where the parameters

x > b,

y = b,

y
y>b,

b are taken from B. It is easy to show that simple binary relations

on Q can be characterized as the binary relations that are invariant under all order automorphisms of Q which stabilize each element of B. We will show that there is the least simple binary relation on Q over dP containing P; we denote it by Inv(P). For the P from the example above, Inv(P) is the union of two squares, (0,l) x (0,l) and ( 1,2) x (1.2). It is easy to see that Inv( P) can bc uniformly obtained from P by means of a binary first-order query. It can be shown it is the crucial point - that it always the case that P = Inv(P) n D. We call a set of the form I x J, where I and J are B-minimal l-cells, a B-minimal 2-cell. It is easy to see that any simple binary relation over B can be uniquely decomposed into a disjoint union of B-minimal 2-cells. For instance, in the example above Inv(P) is the disjoint union of two (0,1,2}-cells (0, 1) x (0,l) and ( I, 2) x ( I. 2). Clearly,

there are finitely many B-minimal

2-cells,

for any finite B.

If we know ?P, to reconstruct Inv(P), we need only to know which of the iPminimal 2-cells are contained in h-iv(P). As there are 5 types of dP-minimal l-cells, there are 25 types of ?P-minimal 2-cells. With every type r E 5’ of c?P-minimal 2-cells we associate a relation S- on the finite set ?P with the information which of the ZP-minimal 2-cells are contained in Inv(P). The arity of S, depends on r and is equal to the number of the b’s involved in representations of 2-cells of type r. Say. with the 2-cells I x J, where I is of type (I ) and J is of type (4) WC associate the following ternary relation S,b on iTP. For a, b. c E (7P, we consider Sl;l(cc, b, c) to be true iff {u} x (b,c) is a i;P-minimal 2-cell and is contained in Inv(P). For P in the example above, SJJ = ((0,l,O,I), ( 1,2. 1,2)}, SOO= false, and S, = ti for all remaining T E 5’. For any r E 5’, we can uniformly obtain the finite relation ST on ?P from lnv(P) and ?P (and so from P) by means of a FO query.

100

0. K Beleyradek

et al. IAnnals

of Pure and Applied Logic 97 (1999) 85-125

On the other hand, if we know the finite relations recover Inv(P)

true for P. So in the binary Actually,

the arguments

set. However, linear

ordered

dP and all ST’s, we can uniformly

from them, by means of a FO query. As P = Inv(P) CTD, the same is case we have the result we need.

above work not only for Q but for an arbitrary dense ordered

we will prove the result not only in the dense case, but for an arbitrary set. In that case some extra technical

8P arise, because

in general

situation

for a finitely

problems

with the definition

representable

relation

of

the least set

over which the relation can be defined does not exist: for example, in Z the relation x > 0 can be represented not only over { 0) but also over { 1}, because x > 0 iff x 3 1. Nevertheless, even in general case it turns out to be possible to define for any finitely represented relation P a certain canonical finite set of parameters aP, over which P can be defined and which can be uniformly obtained from P by means of a FO query. Now we pass to the general

case. We work over an arbitrary

(but fixed) linearly

ordered set U. Our aim is to find for finitely representable relations on U, in a sense, a canonical finite representation. We begin with a special case of the so-called simple relations. A relation R on U is said to be simple if it can be finitely represented by a disjunction of conjunctions of formulas of the forms x c, or x = c, where x is a variable and c is a name of an element of U. For k 2 1, we call sets of the form Ii x . x Ik, where each Ii is a singleton or an open interval in U k-cells in U. Here an open interval in U is a set defined by a formula of one of the following forms: x=x; a
Simple relations

can be characterized

as follows.

Lemma 4.1. For a jinite set B, a relation P on U is a simple relation over B iff P is B-invariant. Here P is said to be B-invariant if 2 E P iff & E P, for any tuples E and & such that ai and b, are positioned the same way with respect to the elements of B, for all i. The proof of the lemma is obvious. Consider the following binary relation Ek(_f, j) on Uk :x;
A

aj=bjA

( i@J,

l\(ai=UAbj=v) JEJ,

Hence, this relation

+(P(Z)=P(b)). )

of inseparability

is expressible

as a restricted

query.

0. V. Belegradek et al. I Annals of Pure and iipplied Logic 97 (1999)

101

85-125

For PC D. an element x E U is said to be a boundary point of P if either there is _v such that .r
and for any y<.x

there is a pair of P-separable

elements

or there is y such that y > x and for any y > x there is a pair of P-separable in [x, y]. Here [u, U] = {z : u
in Lemma

of P or is adjacent to such a constant.

definition

each prime relation

So the set of the boundary

P is finite and can be expressed

is called prime iff it is ,SnD for a simple relation In Lemmas

4.2-4.5

elements

points of P. It

point of P is a constant

4.3 that any boundary

as a restricted

in [J~.x],

in every points for

query. A relation

S.

below, let S be a simple relation

defined

otter a ,jinite set B,

and P=SrD.

Lemma 4.2.

[f x
and

[x, y]

n B = 0,

there

is no pair

of P-separable

elements

in [x, y].

Proof. Let u. 2;E [x, y]. Let a,6 E D, and 1 6 i
Lemma 4.3. Any boundary point of P is an element of’B or is adjacent to an element of’ B. In particular, aP is jinite. Proof. If z is neither an element of B nor adjacent to an element of B, there are x, y such that x
lemma is crucial in our consideration

Lemma 4.4. rf’ I < y and x, y are P-separable,

[x, y] n ?P # 0.

Proof. By Lemma 4.2, [x, y] n B # 0. Let [x, y] n B = {bl, , b,,}, bl <
Aa,=W A( a, =x iCJ,

A d, = y)

IEJ,

Let bo be X, b,,, I be y, and for k = 0..

A

a(k)j = ai /\ A a(

, E.L

A (P(Z) $ P(d)).

iEJ,

= bk

, n + 1, E(k) be such a sequence

that

0. V.

102

Belegradek et al. IAnnals of Pure and Applied Logic 97 (1999) 85-125

There is such a k that (P(a(k))

$ P(a(k + 1))).

It means that bk, b,++l is P-separable. Towards a contradiction, suppose that neither x, y nor the hi’s are boundary points for all i. Indeed, there are u > bi and u < bi+ 1 of P. Then bi and bi+l are P-inseparable, such that in [bi, u] and [v, b,+l] there are no P-separable pairs of elements. If u> b,+l or v < bi, we are done. If b; < v 6 u < b,, I, the pairs b,, v and v, bi+ 1 are P-inseparable, and hence the pair bi, bitI is P-inseparable, too. In the case bi
the least 8P-invariant

relation

0 containing

P. Clearly,

Inv(P)

con-

sists of all k-tuples 6 for which there is a E P such that ai and b, are positioned the same way with respect to dP, for all i. By Lemma 4.1, Inv(P) is a simple relation over ap. Lemma 4.5. P = Inv(P) n D. Proof. We need to prove that there are no a E P and & E D\P such that ai and bi are positioned the same way with respect to dP, for all i. Suppose there is a counterexample pair a,$. Let il E JI, . . , i,sE J,; we can assume that x,, < .
a, and ci are positioned

the same way with

respect to ap, for all i; so a, F is a counterexample pair. Since a;, = ci, for 16 Z bi,,,. Let C= (cl,. . . , ck ) be the result of replacement in the tuple a the elements ui with him, for all j E J,,, . Clearly, C E D. Due to the P-inseparability of ai,,, and bin,, we have C E P. The elements Ci and bi are positioned the same way with respect to aP, for all i, so C, b is a counterexample pair. Since c;, = b;, for 1 < 1 dm, we have a contradiction with the maximality of m. 0 Any k-ary relation P is the disjoint union of all P n D, where D runs over the set of &-ChSSCS. Obviously, if P is finitely representable, every such P nD is equal to snD, for some simple relation 5’. So Lemma 4.5 implies Corollary 4.6. Any finitely represented k-ary relation P is the disjoint union of all Inv(P n D) fl D, where D runs over the set of equivalence classes of Ek.

(3. I’. Belegrudek

et al. I Annals qf Pure and Applied

Let P be a finitely representable k-ary relation. Denote ?(P n 0). As Inv(P n D) is defined over ?(P n D), we have Corollary

4.7. Any finitely

represented

Thus, with every finitely represented ical finite set of parameters

by i?P the union

of all

relation P is dqfined OWP c?P relation

P we have associated

8P, over which the relation

a sense, reduced to a finite family

103

Loyic 97 11999) 85-125

{Inv(Pn

a certain canon-

is defined; the relation P is, in

D)} of simple relations

over the set PP.

Moreover, the set dP and the family {Inv(P OD)} can be found uniformly in P (by means of certain FO queries), and P can be uniformly recovered from the set ?P and the family { Inv(P n D)} (by means of a certain FO query). Now we are going to find a canonical representation for simple relations. Let S be a simple k-ary relation over a finite set B. For a non-empty B, we call a k-cell 11 x x 1~ B-minimal if every Z, can be defined by a formula of one of the following forms: .X=h,,

x
b,
6,
where B={bl,..., b,,} and 61 < cb,,. The only B-minimal k-sell is, by definition, the cell U”. Obviously, the set of B-minimal k-cells is finite. Clearly, the B-minimal k-cells are pairwise disjoint. Moreover, if a k-cell C’ is defined over B and a k-cell C is B-minimal then CC C’ provided CO C’ # 0. It follows that S can be decomposed into a disjoint union of B-minimal k-cells, namely, into the disjoint union of all B-minimal k-cells which are contained in S. Note that some of the B-minimal k-cells can be empty. We show how to encode the simple relation S by a finite family of relations on the finite set B. Every l-cell over B is defined by a formula of one of the following forms: (0) ?I =x;

(1) x=b;

(2) x
(3) b<_u:

where 6, b’ t B. For i < 5, denote by n, the number (i); so no==O, n1 =nz=q= For any r=(zl,...,rx)~5’,

(4) b
1, and n.+=2. we are going to associate

from B in the formula

with S and B a relation

S,

on B of arity n, = n,, + . + n,,, . Let an n,-tuple of variables ,j = (y,. . . , y,,,) is the concatenation of tuples J,, . . T,_, where the length of v, is n,, For i = I,. , k, denote by $,(.)ci, J, ) the formula 0 x,=x, if nT, =O, 0 x, = 11if 11: = I and jj, is L‘, l x, c if nr, = 3 and Ji is v, l U
0. V. Belegradek

104

For an n,-tuple B-minimal

et al. /Annals

of Pure

and Applied Logic 97 (1999)

85-125

b in U, we define S,(g) to be true if & is in B, and the k-cell C,(b) is

and is contained

that, for i # 1, the interval

in S. Clearly, the B-minimality &( U, bi) has no common

It is easy to see that the relations

of the k-cell means exactly

points with B.

ST can be uniformly

obtained

from S and B by

means of certain FO queries err. As S is the union of all k-cells C,(g) for which S,(5) holds (r E 5k, g E Bn7), one can uniformly by means

of a certain

recover S from B and the family

FO query X. Namely,

{ST}, E sk

II says that, for one of the r’s, there is

an n,-tuple & in B such that both S,(b) and &(.?,b) hold. Later we will need the following observation concerning

the definition

of rc.

Observation. Suppose A = {al,. . . , a,,,} 5 U with al < . .
%=(A,&, <,al,...,a,),,5k, which says that, for one of the z’s, there is an n,-tuple 5 in the set

such that both R,(5) and &(X,5) hold So we can assert not only that the relation x(A, {R,}) is finitely representable over A but, moreover, that there is a certain ‘standard’ finite representation for it over A which depends only on the isomorphism type of %. Based on the analysis

above and taking

into account

Corollary

4.6, it is an easy

exercise to prove Lemma 4.8. Consider the following

two database schemes n and 0. The scheme n consists of one k-ary symbol P; the scheme 8 consists of a unary symbol B and n,-ary symbols SO,, for z E 5k and Ek-classes D. 1. There is a unary FO n-query 6 which, for any finitely represented k-ary input P, yields a finite set 8P as the answer. 2. For any z E 5k and any Ek-ChSS D, there is a n,-ary FO n-query gnr which, for any finitely represented k-ary input P, yields the jinite relation Inv(P n D)r on aP as the answer. 3. There is a k-ary FO o-query rc which for any finite input B, (SD, : z E 5k, Dis a

Ek-chss),

yields as an answer a relation finitely representable over B. 4. The family of queries 6, {am} is an inverse for the query IZ in the following sense: for any finitely represented k-ary input P, we have P = ,(6(P), {am(P)}). We summarize

the consideration

above in the following

main results.

0. V. Belegrudek et al. I Annals qf Pure and Applied Logic 97 (1999)

Theorem 4.9. For any jinite database scheme y = {PI,. . ,&} l

a database scheme H= {B, S,, . . . , &},

l

n-queries 6 of arity 1 and oi of arity of Sj, for 1 d i
85--125

105

there are:

where B is unary

0 locally generic O-queries xi of arity of P,, ,for 1 d j dn such that (a) For any3,finitely representable n-input p, the .family of n-queries 5 = (6, cr,} yields a finite U-state as the answer. (b) For an.)’finite e-state s, the ,familv of B-queries it = {7-r,} yields as the answer an n-state finitely representable over B. (c) For any n-query, which is locally, generic over jnitely representable states. the result of replacement of PI,. . , P,, in it Mjithx1,. . n,, is locally generic over ,finite H-states. - (d) it is an inverse of‘ 5 in the follocrkg sense: 7-r(o(p)) = p, .for any finitely representable n-state p. Note that (c) here immediately definition of rc.

follows

from the observation

above concerning

the

Theorem 4.10. For any expanded ordered universe U, if (1) .for any’ finite database scheme p, any locally generic over jinite states extended p-query> is equivalent over finite states over U to a restricted p-query’ then (2) ,for any’ jnite database scheme n, any locally generic over jinite representable states extended n-query is equivalent over jinite representable states over U to a restricted n-query. Proof.

Suppose (1) is true. Fix a finite database

scheme q= {PI,.

, P,,}. Let @ bc a

locally generic over finitely representable states extended q-query. We use Theorem 4.9. First we replace in @ the relation names PI,. . .I$ with the formulas ~1,. . . rc,?; we obtain a locally generic over finite states extended H-query Y. By (l),

the query

Y is equivalent

we replace in Y, the relation we obtain

a restricted

we have proven

(2).

q-query

over finite states to a restricted

names B,S,, . @I equivalent

,S,

with the formulas

over finite representable

O-query ‘PI. Now 6, ~1,. . . a,,. Then states to @. So

q

5. Collapse of extended locally generic queries In this section, we pursue collapse results over finite states. However, all the results can be transfered to finitely representable states by directly applying Theorem 4.10. Our ultimate goal is to prove that, under certain conditions on the universe U, any locally generic extended query is equivalent over finite states over U to a restricted query. Hence, it suffices to prove such a result for Boolean queries (for database schemes with constant symbols).

106

0. K Belegradek

For an arbitrary L-sentences

et al. IAnnals

signature

(that is, formulas

of structures

of an arbitrary

theory of K (in symbols,

qf Pure and Applied Logic 97 (1999) 85-125

L, an L-theory of signature signature

Th(K))

is defined

L without

(in symbols,

free variables).

L (in symbols,

L-structures),

For a class K the first-order

L-

is defined to be the set of all first-order L-sentences

which hold in every structure in K. Two L-structures equivalent

to be a set of first-order

A4 and N are called elementarily

M = N), if 4 holds in A4 iff C#Jholds in N, for any L-sentence

4. An L-theory T is said to be complete if all its models are elementarily equivalent. Let p be a database scheme {RI,. ..,R,,,cl . . . . q.}. We denote L U p by L(p). A p-state s over an L-structure W is said to be pseudo-jnite in W if (W,s) is a model of the first-order L(p)-theory F( W, p) of all (W, r), where r is a finite p-state over W. For a first-order L(p)-sentence $ and m
the elements of A. We do not names. (in symbols, A4 $ N or N 3 M), 4 holds in N, for any L(M)-

sentence 4. A set p of first-order L(A)-formulas with one free variable x is said to be a type over A in A4 if every finite subset {$I (x), . , $k(.x)} of p is realized in A4 (that is, (Zk)(~$l(x)& &c$~(x)) holds in M), and, for every L(A)-formula 4(x), either 4 E p or -4 E p. We say that a subset q of p isolates p if p is the only type over A in M containing q. Let A be a subset of M. For any N +M and a EN, the set of all L(A)-formulas 4(x) such that $(a) holds in N forms a type over A in M; denote it by tp (a/A). For any type p over A in M, there are N > M and a EN such that p = tp (a/A). We denote tp(A) the set of all L(A)-sentences which hold in M. For a cardinal A, a structure M is said to be %-saturated if any type p over any its subset A of power
0. V Belegradek et al. l Annals of Pure and Applied Logic 97 (1999)

Here p-,

as usual,

ily equivalent L-structure

denotes

special

the least cardinal

structures

M and any cardinal cardinals

than p. Every two elementar-

of the same power are isomorphic. For any infinite i.> 1L1,lM 1 with i” = A, there exists a special N + M

of power i. Here N: is defined to be C,,, easy to construct

greater

y ZNb, and /MI is the cardinality

i, with i* = I of arbitrarily

p-query

$ which is equivalent

of M. It is

large cofinality.

Theorem 5.1. For uny universe U and an?! Boolean extended conditions are equivalent: 1. there is a restricted

107

KS-125

p-query

$I thr,follon~ing

to C#Iover ,jinite database

states

over U; 2. C$ is generic ji)r pseudo-finite

states over V, for ail V 3 U; 3. ,fbr some uncountable power K with K= I?, the query 4 is generic over pseudojinite states over a special model V E U with j Vi = I<.

The following proof works not only for Lo = { < } but for an arbitrary result can be considered as a finite model theory analog of Theorem 3.5.

LO. So the

Proof. (1) 3 (2). Suppose 4 is equivalent to a restricted query $, for finite database states over U. Then C#J c-) $ is in F(U, p) and so in F( V, p), for every V E U. As I/J, being restricted, is generic even for all states over V, the genericity of CJ for pseudofinite states in V follows. (2) * (3) is trivial. (3 ) =+ ( 1). Let T = Th( U). First we show that (3 ) implies following set of formulas

r=F(T,j)u {O(p)~@p’) Towards

a contradiction,

: 6

is

an

Lo(p)-sentence}

U

the inconsistency

{4(p),

of the

7&p’)}

suppose ( W. r. r’ ) is a model of r. We can assume that it is

a special model and 1WI = JC.Then its reducts too. As W and V are elementarily

equivalent

W, ( WI&,r)

and ( WILo,r') are special,

special models of the same cardinality.

W

and V are isomorphic. Due to r, the models (WILo,r) and (W lLo,r’) are elementarily equivalent and hence isomorphic. In other words, there is an La-automorphism of W which transforms r to Y’. As (u, r’) is pseudo-finite in W, and Cp(p) holds in (W, r) but &p’)

fails in (W,p’),

the query 4 is not generic

V is isomorphic to W, we have a contradiction By compactness, there is a finite inconsistent Lo(p)-sentences (10,. . , O,,- I,

for pseudo-finite

states in W. Since

with (3). part of r. Then, for some m < (1) and

QT. P). A (UP) H NP’))> 4(P) k &P’). i .: 11, Denote 8’ =: 0, 0” = -8. query 43 is equivalent, A,,,, 0;‘. II

It easily follows that, for some 50,. , T/_ 1 E 2”‘, the extended for finite states over U, to the restricted query $ = v,< ,

108

0. l? Belegradek

ei al. /Annals

Let I be a subset of a universe

of Pure and Applied Logic 97 (1999)

V. We say that a Boolean

85-125

extended

is locally generic over pseudo-finite states over I in V if the following p-state (r,~‘) over I is pseudo-finite Lo-isomorphism A linearly

in V then 4(p)

in V and r can be transformed

holds in (V,r) iff $(p’)

p-query

$I

holds: if an

into r’ by a partial

holds in (V,r’).

ordered subset I of a structure M is said to be an indiscernible sequence

in M if Q(G) holds in M iff O(6) holds in M, for every first-order L-formula

8(x,, . . . ,x,)

and any two n-tuples G and g in Z with aI< ...
Ramsey

well-known

fact (see [7]) which is an easy corollary

of

theorem.

Let A4 be an injinite L-structure, and < a linear ordering of the universe of M. Then, for every L-formula 0(x, , . . ,x,), there is an injinite subset I of A4 which is a g-indiscernible sequence with respect to C. Ramsey’s Theorem.

Theorem 5.2. Let an extended Boolean p-query 4 be locally generic for finite states

over U. Suppose, for some uncountable K with K = K*, there is a special model V E U of power u such that, for any infinite indiscernible sequence I in V, the query 4 is locally generic over pseudo-jnite states over I in V. Then 4 is equivalent over finite states over U to a restricted p-query. Proof. Suppose the contrary. Let K and V satisfy the conditions of the theorem. By Theorem 5.1, there exist a model W z U and a pseudo-finite p-state (p, p’) over W < -automorphism h of W transforms p to p’, but (W, p) b 4(p) and k --$(p’). Clearly, we can assume that ( W, p, p’, h) is a special model of power we can assume W = V.

such that some ( W, p’) K; so

Let g and (T’ be copies of p such that p,p’,~,cr’

are pairwise

disjoint.

Let

where F,FI are new binary relation symbols and I is a new unary relation symbol. Let T = Th( U). We will prove the consistency of the set of first-order L(q)-sentences r which say about an y-state (r, r’. s, s’, F,F’, I) over a model of T the following: 1. (r, r’) satisfies Th( V, p, p’); 2. (r,r’,s,s’,F,F’,I) satisfies F(T,n); 3. F and F’ are partial < -isomorphisms transforming Y to s and r’ to s’, respectively; 4. s and s’ are states over I; 5. there are at least n distinct elements in I, for all n
0.1:

Belegradek

Let (M, Y,r’, s, s’, F,F’,I) (M. r, Y’) is isomorphic to (2)

the y-state

< -isomorphism Due to (5-6).

et al. I Annals of‘ Pure and Applwd

Logic 97 (1999)

I 00

85-125

be a special model of power ti for r. Due to ( 1 ), we have to (V, p, JI’); so we can assume that (M, r, r’) = (V, p, p’). Due

(r,#,s,s’,F,F’,Z)

is pseudo-finite in V. Due to (3) the partial s to s’, which, due to (4) are states over I.

y = F’ oh o F- ’ transforms I is an infinite

L-indiscernible

set in V. Due to (7)

s satisfies

4(n).

but s’ does not satisfy &cr’). It follows that 4 is not locally generic over pseudo-finite states over I in V, a contradiction. By compactness, it remains to prove the finite consistency of r. It suffices to show that, for every ;’ E Th( V, p, p’), every natural number n < (~1and every L-formula (I(S), there is a finite q-state (r, r’,s,s’, F, F’, I) over V, which satisfies y, (3), (4), and (7 ). and such that I is a O-indiscernible sequence of cardinality at least n. By the corollary of Ramsey’s Theorem mentioned above, we can find an infinite O-indiscernible sequence J in V. As (p, p’) is pseudo-finite, there is a finite p-state (r, v’ ) over I’ that satisfies y A 4(p) A -&p’ ). Let I be an arbitrary finite subset of ./ of cardinality at least n. It is easy to find finite s,s’, F, F’ which satisfy (3) and (4). Since 4 is locally generic, we have (7). The finite consistency of r is proved, and the proof is completed. 3 As a side remark, note so-called active semantics. An FO formula is said ativization of every of its active domain.

that this technique implies a result from [S, 181 about the But the proof in [18] is shorter than our proof. to be active if it is obtained from some formula by relquantifiers with respect to the formula AD(x) isolating the

Theorem 5.3. For ,jinite states, any locally generic actire extended to u restricted query. Proof.

By Theorem

query is equir~alent

5.2, it suffices to show that any active Boolean

query is locally

generic over arbitrayl states over any indiscernible sequence in any V. We may assume that the signature L is relational. For a p-state r over V, denote by V,. the substructure of (V.r) with domain AD(r). (V,r). Since, for any p-states

Clearly, an active p-query holds in V,. iff it holds in r and r’ over an indiscernible sequence I in V. any

partial Lo-isomorphism transforming V,. and V,.f, the result follows. 0

v into Y’ induces

an L(p)-isomorphism

between

Now our aim is to give a general condition on a complete theory which ensures collapse of locally order-generic queries to pure order ones, over finite states over models of T. Let M and N be L-structures, A be a subset of M, and B be a subset of ,Y. A bijection h : A + B is said to be a partial L-isomorphism (an elementar~~ map) from A4 to N if 4(E) holds in M iff 4(h(ii)) holds in N, for any atomic L-formula (for any L-formula) 4(Z) and any mple a in A. A partial L-isomorphism (an elementary map) from A4 to M is called a partial L-isomorphism (an elementary map) in M. Clearly,

110

0. V. Belegradek

every elementary elimination,

et al. IAnnals

of Pure and Applied Logic 97 (1999)

map in A4 is a partial

the converse

We recall the following

isomorphism

85-125

in M; if M admits

quantifier

is also true. well-known

result (see [24, 251):

Fact. Let T be a complete L-theory. Then the following are equivalent:

(1) T admits quantifier elimination; (2) there is an injinite cardinal 2 such that, for every finitely generated L-structure A, for every models M, N of T with A CM, N, for every a E N\A, tf M is I_-saturated, the quanttfier-free type of a over A is realized in M; (3) there is an infinite cardinal ;1 such that every &saturated model M of T is finitely homogeneous in the following sense: for any partial isomorphism h : A -+ B in M with jinite A and B, and any a EM there is b EM such that h U {(a, b)} is a partial isomorphism in M. Let T be an L-theory, and T’ be an L’-theory with L CL’ and T C T’. The theory T’ is said to be a definitional extension of T if every L’-formula is equivalent in T’ to an L-formula. Every L-theory T has a standard definitional extension admitting quantifier elimination: for every L-formula 4(Z) with n free variables add a new n-ary relation symbol P$ to L and a new axiom VT((P$(X) c) 4(X)) to T. We say that a complete L-theory T has the Pseudo-Jinite Homogeneity Property if there exist its definitional extension T’ of a signature L’ and an infinite cardinal A such that, whenever A and B are pseudo-finite sets in a model M’ of T’, and h : A -+ B is a partial isomorphism in M’ with A-saturated (M’,A, B, h), for any a E M’ there is b EM’ such that h U {(a, b)} is a partial isomorphism in M’. Note that, by the Fact above, the theory T’ here automatically admits quantifier elimination, because any finite set in M’ is pseudo-finite, and if M’ is A-saturated then

(M’,A, B, h) is i-saturated,

too, for finite A and B.

Therefore the definition of the Pseudo-finite Homogeneity Property admits the following equivalent formulation: a complete L-theory T has the Pseudo-finite Homogeneity Property iff there exists an infinite cardinal A such that, whenever A and B are pseudo-finite

sets in a model M of T, and h : A -+B is an elementary

map in M

with A-saturated (M. A, B, h), for any a EM there is b EM such that h U {(a, b)} is an elementary map in M. The Pseudo-finite Homogeneity Property makes sense not only for theories of ordered universes, and there are obvious examples of theories with this property. For example, in infinite structures of empty signature the pseudo-finite sets are exactly sets whose complements are infinite; hence the Pseudo-finite Homogeneity Property for the theory of these structures easily follows. It turned out that for ordered structures the property is especially interesting because it gives a sufficient condition for collapse results. Later we will give a series of examples of ordered universes with this property. Theorem 5.4. Suppose the first-order theory of a universe U has the Pseudo-finite Homogeneity Property. Let an extended query 4 be locally generic over finite states over U. Then C$is equivalent over finite states over U to a restricted query.

0. C’. Belegradek

Proof.

et ul. I Artnalx of’ Pure and Applied Loyic, 97

It suffices to prove that 4 satisfies the condition

witnesses

that T has the Pseudo-finite

and cf(x) > i,. Let L-indiscernible active domain that 4(p)

V z U be a special

sequence

I’ can be transformed

Homogeneity model

i 1999) KS/.?5

of Theorem

Property.

of power

Ill

5.2. Suppose

K. Let I be an infinite

in V. Suppose p-state (1..Y’) over I is pseudo-finite

to r’ by a partial La-isomorphism

i

Let K = K‘ > IL1 -C No, in V and

9 in V, whose domain is A, the

of Y, and whose range is A’, the active domain of r’. We need to show

holds in (V, r) iff $(p’)

holds in (V, r’). We may assume that (V, A,A’. g) is

i.-saturated. (Indeed, consider a special model ( VO,YO,r&go, IO) of power K elementarily equivalent to ( V,Y,Y’, g,l). It suffices to prove the claim for (Vo, r-(),$ g(),Zo); but it is i.-saturated as cf(ti)> A.) Using a Fra’issi-Ehrenfeucht game, we will show that 6) is an L( p)-elementary map from (V, v) to (V. r’). Due to the L-indiscernibility of I, the map g is an L-elementary map, and, in particular, a partial L(p)-isomorphism. Therefore, due to the Pseudo-finite Homogeneity Property, to complete the proof of the theorem. using Theorem 5.2, it suffices to prove the following lemmas: Lemma 5.5. The active domain qf’anj’ pseudoYjinite .set.

datuhase

state is II pseudo-finite

.set in V. and a E V. Then A U {a}

Lemma 5.6. Let A he a pseudo,finite finite set. Lemma 5.7. [f’ h : C + D is a partial k-saturated, then

isomorphism

is u pseudo-

in V. and M = (V. c’, D. h) is

M’=(I’.C~{c},D~{d},hu{(c,d)}) is i.-saturated.

jar aq~ c, d E V.

Proof of Lemma 5.5. Consider the database scheme T = {P}, where P is a unary rclation name. For any L(z)-sentence y, there is an L(p)-sentence ;I* such that (V.s) I= ;” iff ( V, AD(s)) + 7, for any p-state s. Suppose a state s is pseudo-finite in I’, and ;I E F( V, 5). Since the active domain for all finite p-states

of any finite state is finite, we have (V.I.) + ;s’

r. So (V,s) b ;‘*, and hence (V,AD(s))

+ ;‘. C

Proof of Lemma 5.6. Consider the database scheme 5 = {P}? where P is a unary relation name. Let 0 E F( V, T). Let f)*(x) be the result of replacement of every occurrence of P(y) in (1 with P(y) V y =_Y, where x is a new variable. Then ‘d.rH”(r) belongs to F( V, t) and so holds in (V,A). Hence (I holds in (V.,4 U {a}). Thus. A u {a) is pseudo-finite. r~l Proof of Lemma 5.7. M’ is definable c,d. L

in the i.-saturated

structure

A4 with parameters

Let A0 be A, Bo be B, and go be g. It suffices to prove that Duplicator has a winning strategy in the game. The desired winning strategy is to ensure that, after each round i

112

0. V. Belegradek

et al. I Annals of Pure and Applied Logic 97 (1999)

of the game, A, and Bi are pseudo-finite in I’ with A-saturated (V,r)

85-125

sets in V, gi : Ai -+ Bi is an elementary

(V,Ai,Bi, gi), g C gi, and gi is a partial L(p)-isomorphism

map from

to (V,r’).

Suppose

Spoiler

starts a new round

bj+r E V). By the Pseudo-finite

i + 1 and chooses

Homogeneity

Property,

an element

ingly, ai+i E V) such that gi+i = gi U {(ai+, , bi+l )} is an elementary Duplicator

chooses bi+l (correspondingly,

ai+i E V (or

there is b;+l E V (correspondmap in Y. Then

gi+i ). Let Ai+t = Ai U {a;+~ } and Bi+i = Bi U

{b,+l }. By the definition

of g, g,+l is a partial L(p)-isomorphism from (V, r) to ( V, Y’). By Lemma 5.6, Ai+i and Bi+r are pseudo-finite sets. By Lemma 5.7, (V,:Ai+l,Bi+l,gi+i) is I-saturated. The collapse result is proved. 0 Now we introduce a certain property of complete theories which is strictly stronger than the Pseudo-finite Homogeneity Property, and so ensures the collapse result, too. We say that a complete theory T has the Isolation Property, if there is a cardinal Jti such that, for any pseudo-finite set A and any element a in a model of T, there is As c A with lAoI < 2 such that tp (a/&) isolates tp (a/A). Theorem 5.8. The

Isolation

Property

implies

the

Pseudo-jinite

Homogeneity

Property. that T has the Isolation Property witnesses that T Property. Let V be a il-saturated model of T, and

Proof. We show that 1 witnessing has the Pseudo-finite Homogeneity

A, B pseudo-finite

sets in V, and a E V. Let We show that there is b E B such that hU {(a, A0 CA with lAoI < /1 such that po = tp (a/Ao) elementary, h(p) is a type over B, and h(po)

h : A + B be an L-elementary map in I’. 6)) IS an L-elementary map in V. Choose isolates p = tp (a/A). Since the map h is isolates h(p). (For a set q(x) of formulas over A we denote by h(q) the set {g(x, h(c)): 8(x,?) E q}.) As V is A-saturated, there is b E V realizing h(po) and hence h(p). So h U {(a, b)} is an L-elementary map. 0 We will show that any theory

with the Isolation

Property

is unstable.

To prove

the unstability of a theory, it suffices to show that there exists an infinite indiscernible sequence in one of its model which is not an indiscernible set (see [26], Theorem 11.2.13). Theorem 5.9. Any theory with the Isolation Property is unstable. Proof. First we show that, for any is an infinite indiscernible sequence finite set. Consider the infinite set r (where < is a new binary relation which says: l < is a linear order;

complete L-theory T with infinite models, there in a model of T whose members form a pseudoof first-order sentences of the signature L U { < , P} symbol, and P is a new unary relation symbol)

0. V. Beleyradek et al. I Annals of Pure and Applied Logic 97 (1999)

85-125

113

0 P is infinite; l

O(Z)-

I)(h), for any L-formula

@vi,.

,u,,,b~,. . ., h,, in P with

.,IJ,,) and a~,.

al < ‘..
T has the Isolation

by compactness,

one can find a model

F( T, {P} ) U r has a model

sequence

in A4 with respect to <, and the set I

Property,

and i. witnesses

that. By compactness,

we may assume that \I( >A. Stretching I by compactness, we can find an elementary extension (M’, <‘) of (M, <) and an indiscernible sequence I’ in M’ such that I is a proper subsequence of I’. We claim that I’ is not an indiscernible set in M’. let a E Z’\I. By the choice of i, there is Ia c I with I&
Indeed, isolates formula So I’ is

On the other hand, there are obvious examples of stable theories with Pseudofinite Homogeneity Property (for example, the theory of infinite structures of empty signature). Later we will give examples of ordered universes which have the Pseudofinite Homogeneity Property but do not have the Isolation Property (they are, of course, unstable). Theorem 5.12 below gives a broad class of theories with the Isolation Property and provides a lot of examples of collapse results. A complete L-theory T is said to be o-minimal if in every its model any definable set is a finite union of singletons and open intervals. The following characterization of o-minimal theories is not hard to prove. Theorem 5.10. A complete L-theory T is o-minimal ifs there exists T’, u definitional expunsion of T in a lunguuge L’, such that any L’yformulu 0(x, v) is T’-equirulent to a disjunction

of formulas

of the form

,following forms. for some L’-terms I = x,

x = t,

x < t,

t
$(j)

A p(x, J), uahere p(x, _v) bus one of’ the

t and t’ in the variables

y:

t
Proof (hint). The “if” part is trivial. To prove the “only if” part, note that, by compactness, for every L-formula @,y), there is a uniform finite upper bound for the number of boundary points of the sets of the form g(M,G), where M is a model of T and 6 is a tuple in M. Denote by f&a) the ith boundary point of U(M,a). Expanding the models of T by the definable functions fro, we get the class of models whose theory T’ is the desired extension of T by definitions. n We call a complete L-theory T quasi-o-minimal iff there exists T’, a definitional expansion of T in a language L’, such that any L’-formula 0(x, J) is T/-equivalent to a disjunction of formulas of the form 4(x) A I,!@) A p(x. j), where p(x, F) has one of

114

0. V. Belegradek et al. /Annals

the following X=X,

of Pure and Applied Logic 97 (1999) 85-125

forms, for some L/-terms x = t,

By Theorem

x < t,

5.10, every

model of a quasi-o-minimal sets of the form

t
t and t’ in the variables

j?

t
o-minimal

theory

theory any definable

is quasi-o-minimal.

Clearly,

in every

set is a finite union of singletons

and

ZnD, where I is an open interval and D is a set definable without

parameters. There exist quasi-o-minimal theories which are not o-minimal. The simplest example is the theory T of dense ordered sets without endpoints with a distinguished subset which is dense and whose complement is also dense in the universe. It can be easily shown that T is the theory of the structure (R, <, 43). The theory is not o-minimal because the distinguished subset is not a finite union of singletons and open intervals. Standard arguments show that T admits quantifier elimination; obviously, we can take T as T' from the definition of quasi-o-minimality. Another example of a quasi-o-minimal theory is the theory T of (Z, <, +). Indeed, by Presburger’s Theorem, the definitional expansion of the model by the constants 0, 1 and the unary predicates ‘n divides x’, for all positive integers n, admits quantifier elimination. For a positive integer n, define the function fn(x) by the condition O t iff x > fn(t), the theory T' of the definitional expansion of (Z, <, +) by the constants 0, 1 and all the functions fn(x) satisfies the condition of the definition of quasi-o-minimality. However, the theory of (Z, <, +) is not o-minimal because the definable subsets nZ are not finite unions of singletons and open intervals. Similarly, the theory of (N, <, +) is quasi-o-minimal but not o-minimal. New examples of quasi-o-minimal structures can be constructed using the ordered union operation. Let V, be an L{-structure, where L; contains <, and U, is linearly ordered by <, for i = 1,2. We assume that the universes of Ui and U, are disjoint. Let L = L, U L2 U {PI, P2}, where PI and Pl are new unary relation names. The ordered union of Ur and U2 is defined to be the L-structure the universes of U, and U?, and l PL’ is defined to be the universe of l,$,

U, whose universe

is the union of

i ” is defined to be < L’JU < u2 U (Ul x U,), . Q”= QU for any Q E L,\{ <}. A routine induction on the complexity of a formula shows that any L-formula l

is equiv-

alent in U to a positive Boolean combination of L-formulas in each of which all variables, free or bounded, are restricted to PI or are restricted to P2. It follows, in particular, that the models of the theory of U are exactly the ordered unions of U,’ and Ui, where U, z U{ and UZ = U.. So the ordered union of two complete theories of ordered structures can be well-defined. Another obvious consequence is Theorem 5.11. The ordered union oJ’ any two quasi-o-minimal minimal theory.

theories is a quasi-o-

( 1999) K-125

115

is an o-minimal

theory iff

0. V. Brleyradek et al. I Annuls of’ Pure and Applied Logic, 97

Note that the ordered union

of two o-minimal

theories

any model of the first of them has the greatest element them has the least element.

So the construction

or any model of the second of

gives a lot of quasi-o-minimal

theories

which are not o-minimal. Theorem 5.12. Any quasi-o-minimal

theory has the Isolation

Propert},.

Proof. Let .4 be a pseudo-finite set in a model V of a quasi-o-minimal theory T. and a E V. We will show that there is As CA with lAoI < IT\ such that tp (a/AC,) isolates tp (a/A ). Let T’ be the definitional

expansion

Let v(.x, 7) be an L-formula.

It is P-equivalent

of T from the definition to a disjunction

of quasi-o-minimality. (3(x, 4;) of L’-formulas

of the form 4(x) A $($) A p(x, y), where p(x, y) has one of the following some L/-terms t and t’ in the variables j? x=X,

.Y= t,

x < t,

t
forms, for

t <.r < t’.

Denote by So the finite set of all L’-terms t, t’ involved in p in some of the disjuncts of 0. Let F be a finite subset of V. Then, for every d E V. in the finite subset of V (t(5) : t t S(),

CE F,

t(+
there is a maximal element mo(F,d), provided every d E V. in the finite subset of V {t(F): t ES,,,

?EF,

the subset is not empty. Similarly,

for

t(E)>d}

there is a minimal element m”(F,d), provided the subset is not empty. As the set A is pseudo-finite in V, the same holds for A instead of F. Denote m/j = mo(A >u) > and ,‘I = m”(A, a). Let rno be t(,(Ecj), where to E SO, 5,) E A, when rn(/ is defined; otherwise we write rn,, = -cc. Let m” be t”(C’), where t” E So, C” E A, when m0 is defined; otherwise we write m” = x. Clearly, mrj = m” off a = t(c) for some t(F) E S,, and C E A. If m,t # m” then ml) < LI
Since ~(a,?)

holds in V, one of the disjuncts

Q,(U) A

$(C) A p(a,C) of O(a, C) holds; we have 4(x) E tp (a/8) and $(v) E tp (A). If ml, = m” then a = t(c), for some t(v) E So and FE A. In this case tp (a’?) isolates tp(a/A), and we can take E as Ao. Now suppose rno # m". We will show that

tp(A) 1-J P(40>k rnfj
be of the form

116

0. K Belegradek

et al. I Annals of Pure and Applied Logic 97 (1999)

Suppose p(x, j) is of the form t(j)
t(E)
and t’(C”)
t(F)
t(v)
so we have t(F)
85-125


Therefore

belong to tp(A). Then tp(A) together with

The cases when p(x, J) is of the form x
or

similarly.

So the set A0 of all c~~,c” satisfies the desired conditions. Now we give a series of examples

of ordered structures

0 which show that the Isola-

tion Property is strictly weaker than quasi-o-minimality and strictly stronger than the Pseudo-finite Homogeneity Property. Let L = { < ,E} and & be the theory of all the structures of the form (A, < ,I?), where < is a dense ordering without endpoints, and E is an equivalence relation with two class both of which are dense in A. The structure (R, <,E), where E is the equivalence relation whose classes are Q and R\Q, is a model of Tdt; so Tdr is consistent. Standard back-and-forth arguments complete. Also, standard arguments Theorem 5.13. Proof.

show that Tdt is countably categorical and hence show that Tdf admits quantifier elimination.

Tdr is not quasi-o-minimal,

Towards a contradiction,

but has the Isolation

suppose & is quasi-o-minimal.

Property. It easily follows from

the quantifier elimination that every L-formula 4(x) is Td,-equivalent to x =x or x fx. Therefore every definable set in any model of Tdr is a disjoint union of finitely many open intervals and singletons. However, any E-class which is dense and whose complement is also dense, is not of this form, even though it is definable. A contradiction. Now we show that Tdt has the Isolation Property. We prove that, for every pseudofinite set A and any element a in a model of i’&, there is A0 CA with /AoJ<2 such that tp(a/Ao) isolates tp(a/A). If a EA we can take {a} as Ao; so we assume a$A. Since A is pseudo-finite, it has the least element b and the greatest element c, provided A # 0. Suppose a < b. If E(a, b) then, due to the quantifier elimination, the set of formulas

{x
Similarly,

if lE(a, b) then

isolates tp(a/A). So in both the cases we can take {b} as Ao. Analogously, in the case a > c we can take {c} as Ao. If neither a c then, due to the pseudo-finiteness of A, there are a, and a* in A such that a,

E(x,a,)}

0. LT.Belegradek et al. I Annals of Pure and Applied Logic 97 (1999)

isolates tp(a/A).

Similarly,

if lE(u,a,)

117

85-125

then

(u*
So in both the cases we can take {~,,a*} Property

for zf;if is proved.

the structures

as A0

0

of the form (A. <,E),

where

(A, < ) is a dense

linearly

ordered set without endpoints, and E is an equivalence relation on A with infinitely many classes all of which are dense. An example of such a structure is (R, <, E), where E(x, y) means .Y- y E Q. Standard back-and-forth arguments show that the theory 7;,,, of such structures is countably categorical and hence complete. Also, standard arguments show that G,~ admits quantifier elimination. Theorem 5.14. i’& does not huve the Isolation Property,, but has the Pseudo:finite Homogeneity Property in the follovtliny strong sense: jtir every model M oj’ 7;,C2, trhenever A and B are pseudo-jnite sets in M, and h : A -+ B is a partial isomorphism in M, .fbr any a EM in M.

there is b EM

such that h U {(a. b)} is a purtial

isomorphism

Proof. The following observation is crucial for the proof: for every pseudo-finite subset c’ of a model of TdrJ,every open interval in the model contains an element which is equivalent to no element of C. Clearly, it suffices to show that for an arbitrary finite C. The latter holds because there are infinitely dense in V. To prove there are a At] CA with Since in

the first part pseudo-finite jAo(
many E-classes

in V, and every E-class

is

of the theorem, we show that, for every infinite cardinal i,, set A and an element a in a model of 7;,, such that, for no type tp(u/Ao) isolates tp(u/A). of Tdr there are finite sets of arbitrarily large size whose

elements are pairwise non-equivalent, we can find, by compactness, a pseudo-finite set A in a model U of zie with IAl 32 whose elements are pairwise non-equivalent. Let c be the greatest element of A. Choose a E U such that a >c, and a is equivalent to no element

of A. We claim that tp(u/Aa)

subset A0 of A. Indeed,

due to the quantifier

does not isolate tp(u/A), elimination,

for any proper

the set of formulas

4 = {d d for each d E il. Since A is pseudo-finite, it has the greatest element. Denote it by c; then h(c) is the greatest element of B. If a is E-equivalent

118

0. V. Belegradek

et al. I Annals of’ Pure and Applied Logic 97 (1999)

to some element

u’ E A, one can take as b an arbitrary

and E-equivalent

to h(a’). If a is E-equivalent

an arbitrary

element

of V which is >/r(c)

element

to no element

and E-equivalent

finiteness

there are a’, u” E A such that a’

in B.

similarly.


of A, there are a, and a* in A such that a,
of a, in A. If a is E-equivalent

of V which is > h(c) in A, one can take as b

to no element

The case when a
85-125

Then, due to the pseudo-


a’ E A, one can take as b an arbitrary

element of V which lies between h(a,) and h(a*), and is E-equivalent to /~(a’). If a is E-equivalent to no element of A, one can take as b an arbitrary element of V which lies between ,+(a,) and h(a*), and E-equivalent to no element of B. 0 Let F be an ordered division ring, tor spaces over F with a distinguished

To be the first-order theory of ordered vecsubspace, and Td, be the first-order theory of

ordered nonzero vector spaces over F with a distinguished

proper dense subspace. Here

an ordered vector space over F is defined to be a vector space V over F whose additive group is linearly ordered so that ccv is positive, for any positive cyE F and any positive v E V. We consider To and & in the signature {+, <, ,fz, P}ix TV, where fE is a name for the unary operation of multiplication by the scalar SI, and P is a name for the distinguished subspace. The theory To is obviously consistent. We will show the consistency of Tds in the proof of Theorem 5.15 below. A first-order theory T is said to be model complete iff for all models A and B of T, if A c B then A
T& admits quant$er

elimination, is complete, and is a model comple-

tion of To. Proof.

First we show that any model (U, Ua) of To can be embedded

of l&. We may assume

that

U # UO. It suffices

to find an ordered

into a model vector

space

V 2 U such that some direct complement U’ of U in V is dense. Indeed, then U, + CT’ is a proper dense subspace of V, and (U, Uo) is a submodel of (V, Uo + U’). Note that, for any u, v E U with u < v, in the lexicographic product U x U we have (u, 0) <(w, w) <(v, 0) where w = y. The vector space U x U is the direct sum of its subspace U x (0) and the diagonal subspace of U x U; both of them are isomorphic to U as ordered spaces. Thus, if Ui and Uz are two copies of U, we can extend the orderings on U, and Ul to an ordering on its direct sum lJ, @ Uz, which makes the direct sum an ordered vector space such that between any two distinct elements of U, there is an element from U,. By iterating this construction, we can make the direct sum Ul @ U2 6I3. . . of o copies of U an ordered vector space, which extends each of l.J and in which U, @ U, @ . . is a dense subspace.

Now we show that T,, admits quantifier complete

elimination,

or, equivalently,

is submodel

[25]. It suffices to prove that, for any model A of To and models B and C

of Tl, with A C B, C, if C is saturated free type of h over A is realized

Denote by q(x) the set of all formulas such that 4(h)

over A then, for any h E B\A,

the quantifier-

in C. Let A = (U, Uo). B = (V, V,), and C = ( W. V&). 4(x)

of the forms x
and a
holds in B.

First suppose h E VQ+ U, and b = d + a, where d E V,,, a E U. It suffices to show that q(x) U (P(x - u)} is realized in C. Due to the saturation of C over A, to show the latter, it suffices to prove that means that, for any al.a2 EA Since W” is dense in W, the Now suppose b 4 Vo-t U. It

this set of formulas is finitely satisfiable in C. The lattel with u1
in C. Due to the saturation of C over A, to show the latter, it suffices to prove that this set of formulas is finitely satisfiable in C. The latter means that, for any al. a~ E A with UI
any d,,..., d,,EA,thereisc4d,+W;,,...,d,,+Wosuchthatai
because any models (U, UQ) and (V, JJ’o)of To are embedded into Its model (U x V, UC)x Vu), where x denotes the lexicographic product. Therefore 7;,, IS Property

complete.

0

Note that for the structure First, the locally generic

(R, +, x, <. Q) the collapse result fails. query “the Mumber qf elements qf P is ewn”

over M = (R, +, X. <, Q) is expressible in the first-order extended language. For example, the cardinality which says:

of a subset P of R is even iff (A4.P) satisfies the first-order

sentence

[f P # 0, there is a real number CIsuch that the integral parts [x] qf elements x E rP ure pairwise distinct, and ,for some even positke integer n and some integer m, the remainders me paircrjise distinct

when m is divided bl* n!+ 1, 2(n!)+l,..

and form

.,n(n!)+

I

the set {[xl : .YE crP}.

(The latter sentence is first-order indeed: as of the rational numbers without parameters (see sentence holds, the cardinality of P is obviously dinality of P is n, and n is even. Choose nonzero

Z is first-order definable in the field [23]), it is definable in M, too.) If the even. Suppose P is not empty, the carreal a so that (x-y1 >, 1 for any differ-

ent s, Y E rP. Then [x] are pairwise distinct, for x E crP. Let ([x] : x E UP} = ( rl . , I;,). As n! + 1, 2(n! j + 1. , n(n!) + 1 are pairwise coprime, by the Chinese remainder theorem, there is an integer m such that for 1
0. K Belegradek

120

ordering

without

impossible

et al. IAnnals

endpoints

of Pure and Applied Logic 97 (I999)

with distinguished

as shown in the proof of Theorem

A modification cardinality

of the argument

above

infinite

extended

language,

generic

numbers

query - the latter can be shown

The cardinality

of a set of rational

numbers

this is

query “the

is expressible

even though we know that it cannot

as a restricted

sentence

subsets;

3.4.

shows that the locally

of P is even” over the ordered field of rational

the first-order

first-order

pseudo-finite

85-125

in

be expressed

by the same arguments

as above.

P is even iff (Q, +, x, <, P) satisfies the

which says:

If P # 0, there is a positive

integer k such that kP G Z and, for some even

positive integer n and some integer m, the remainders when m is divided by n! + 1, 2(n!) + 1,. . ,n(n!) + 1 are pairwise distinct and form the set kP. Indeed, if the sentence holds, the cardinality of P is obviously even. Suppose P is not empty, the cardinality of P is n, and n is even. Let k be the product of the denominators of members of P; then kP C Z. Let kP = (~1,. . . , m}. There is an integer m such that for 1 di dn the remainder

when m is divided by i(n!) + 1 is r;, and we are done.

Theorem 5.16. The theory Gs has the Pseudo-jnite Homogeneity Property (with /z = IFI+), but doesn’t have the Isolation Property. For instance, the collapse result holds for any structure of the form (R, +, <,F, fa)aEF, where F is a subfield of R. Proof. First we prove that 7& has the Pseudo-finite Homogeneity Property with 2 = IFI+. Let M = (W, Wo) be a model of l&, where W is an ordered vector space over F, and W, is its proper dense subspace. Let A,B be pseudo-finite subsets in M with Asaturated (M, A, B). Let h : A + B be a partial L-isomorphism in M, and a E W. We need to find b E W such that h U {(a, b)} is a partial isomorphism in M. If a = t(G), where t(f) is a term and a is a tuple in A, one can take t(h(a)) as a b. So we will assume that a # t(a), for every t(f) and 5. Fix a term t(f).

For every finite subset X of W, in (M,X)

for every d E W the set {t(E):ZEX, t(c)
the following

holds:

has a maximal element m,(d,X), and element m’(d,X), provided X # 8. As

A is pseudo-finite in M, the same holds for A instead of X. Let m,(a,A) = t(&) and m’(a,A) = t(Z), where & and 5’ are tuples in A. Denote Jr = h(a,) and @ = h(a’). Suppose a - to(&) E WO, for some term to(X) and tuple & in A. Denote $0 = h(&). It suffices to show that the set of formulas {P(x - to(&)),

t(b,)
t(b’) : t(f)

is a term}

is realized in M. Since M is A-saturated, it suffices to verify that this set is finitely satisfiable in M. The latter holds as to(&) + WO is dense in W. Now suppose that a - t(G) +iWO, for any term t(i) and any tuple 5 in A. For a term t(f) and a new unary relation name Q, denote by &(x, Q) the formula

vz /j i

i

Q(x;) + lP(X - t(Z))

. )

0. V. Belegradek et al. I Annals of Pure and Applied Logic 97 (I 999) KS- 125

121

It suffices to show that the set of formulas {0,(.x, Q), t(h,)
in (MB).

Since (MB)

finitely

satisfiable

tt (X),

, t,,(Z), the set S of solutions

is a term} is Jti-saturated, it suffices to verify that this set is

in M. To prove the latter, it suffices to show that, for any terms of the formula

in (M,B) is dense in W. Since B is pseudo-finite, it suffices to prove that in the case of finite B. Put C, = {t;(i) : 6 E B} and C = Cl U.. U C,,. Since B is finite, the set C is finite, too. Then there is d E W such that d - c @ Wo for all c E C. We have d + W,, & S because if 0,)(d + w, B) fails for some M’E WO then d - c E WO for some c E C,. Since d i- WO is dense in W, the result follows. Now we show that 7;1, does not have the Isolation Property. We will show that, for every cardinal 1, there are a pseudo-finite

set A of

power >,/1 and an element a in a model of T,,y such that tp(a/A) is not isolated by tp(a/Ao), for any proper subset AO of A. Let P,~(xo.. . .,x,,) be a set of L-formulas which says that x0,. . .x,, are linearly independent modulo the subspace P. Let qn(xO.. .,.x,) be a set of L-formulas which says that xg > y, for every linear combination y of xl , . .,x,,. For a new unary relation name Q, let F( T, Q j be the set of all L(Q)-sentences which hold in all (M-X), where X is a finite set in a model A4 of &. Consider the signature L’ which is obtained by adjoining to L(Q) a set of new constant symbols {c. c, : i < i}. Consider the set r of L/-sentences, which is the union of F(T,Q), {Q(c;):i<;}, and all p,)(c,c ,,,..., c,?,), q,?(c.c ,,,..., c,,,)? for il<...i,,
set in M,

(2) a, E A for all i, (3 ) {a, a, : i < Jo} is linearly independent modulo P, (4) a > c, for any linear combination of the a,‘~. In particular,

lA( >,,I. We will show that tp (a/A) is not isolated by tp (a/A”), for any

proper subset A0 of A. Let r(x) be the union of all P,~(x, hl,. . , b,) and q,?(x, bl,. . , b,), where tz< o) and bl,. , b,, are distinct elements of Ao. Clearly, r(x) C t(a/Ao); moreover, r(x) isolates ((alAo> as 7;,, admits quantifier elimination. We have -P(x - ao) E tp (a/A), for any an E A\Ao. Therefore it suffices to prove that r(x) U {P(x - ao)} is consistent. Since A is pseudo-finite, there d EM with d > la/, for every a E A. As M is saturated over d, there is b EM with b> ctd for all x E F. Since P+ao is dense, there is e t P+ao with e > b. Then e realizes T(X). Indeed, let bl, . , b,, E Ao. Then Pn(e, bl , . h,,) holds because e E P + a0 and pn(ao, bl,. , b,,) holds. We have albl +,..+cc,b,,~(1~,/+..,+(a,,/)d
122

0. r

Belegradek

for any cli E F; therefore So, to complete

el al. I Annals of Pure and Applied Logic 97 (1999)

q,(e,

al,.

85-125

. . , a,) holds.

the proof, it suffices to show that r is finitely

satisfiable.

To prove

the latter, we show that, for every n
has a model. Consider

an No-saturated

model (V, Vo) of &.

Due to the No-saturation

of (V, V,), we can choose co,. . . , c,,_I which are linearly independent over V,. It suffices to show that there is c such that p,,(c,co,. . . , cn_l ) and q,,(c,cg,. ,c,,-1) hold because then we can take {CO,. . . , c,_ 1) as Q. Let d be the greatest element among Ico(, . . . , jcn_ 1I. Due to the saturation of (V, Vi) over d, there is b E V with b>ad for all c(E F. Clearly, for every c, if c > b then q,(x, CO,.. . , c,-1 ) holds. For a subset 5’ of F, consider the set of formulas {‘P(x-(o,c,+,.,+a,c,,)):o

I,...,

o,~S}U{x>b}.

Since VO is of infinite index and dense in V, the set is realized in (V, VO), for every finite S. Since (V, VO) is saturated over b, there is c E V with c> b such that p,(c, CO, . . , c,_ 1) holds, and we are done. q The following

picture presents

I

I

our collapse results.

I Divisible

ordered

Abelian

groups

o-minimality

Tdt

Ordered

semigroup

Ordered

group

of natural

of integer

numbers

numbers

Quasi-o-minimality Isolation

Pseudo-finite

Homogeneity

6. Open questions Problem 1. Further work needs to be done for integer numbers. For instance, the authors are under impression that an effective translation algorithm for locally generic queries over (Z, <,-t) can be extracted from a Frai’ssC-Ehrenfeucht-style proof of decidability of Presburger Arithmetic.

0. V. Beleyradek et al. I Annals

Problem 2. In general, expanded

we conjecture

ordered domain,

and locally

generic

of’ Pure and Applied Logic 97 (1999) 85-125 that if, for an expansion

the first-order

extended

there is an effective translation

queries

of (Z, <)

theory of the expanded

do not express

domain

123

or another is decidable

more than restricted

ones, then

algorithm.

Problem 3. Then, how much higher than + in (Z. < ) can we go? Obviously,

+, x

make locally generic extended queries possible to express more than pure order ones because, for example, the query “the cardinality of P is even” is locally generic and expressible in the FO extended language but not in the restricted language. We cot@ture that if, in an expansion of (Z, < ). locally generic extended queries express more than restricted ones, the first-order theory of the expanded domain is undecidable. Problem 4. Moreover,

we conjecture

that if, in an expansion

of

locally generic extended queries express more than restricted ones, then there is a firstorder formula @(x, y) in the language of the expansion such that for any finite subset A of integer numbers A=

{u E Z

In particular,

there is such a natural number

b that

1@(a, b)}.

the Random

Graph is interpretable

in such an expansion.

Problem 5. On the side of finitization, a natural question is, can the results for finitely represented states be extended to more poweri% constraint databases, say, to linear constraint databases? If yes, for which domains? A specific open problem is. can it be done for linear constraints with at least one constant over rational or real numbers. Comments. Anuj Dawar has observed that if the Random Graph is interpretable in an expansion of (Z, < ), then the first-order theory of this expansion is undecidable. Therefore,

truth of our Conjecture

4 would imply truth of our Conjecture

3.

To support our Conjecture 4, we propose the following observation: for any expansion of the ordered set of integers by unary relations, the collapse result holds. In fact, the following more general result holds. Let T,,,, be the first-order theory of a structure ordered set by unary relations. Theorem 6.1. The theory z;,, has the Isokltion

which is an expansion

of a linearly

Property.

Proof. Let M be a model of 7;,,,, and A be a pseudo-finite set in it, a E M\A. We show that there is A0 CA with lAoI <2 such that tp(a/Ao) isolates tp(a/A ). As A is pseudo-finite, one of the following holds: l

There are b and c in A such that there are no elements b <:a
in A between

them, and

124

0. V. Belegradek

et al. IAnnals

of Pure and Applied Logic 97 (1999)

85-125

A has the maximal element b, and a> b. A has the minimal element c, and a
l

in the third case. We will prove arguments

it only for the first case; in other two cases the

are similar. We need to show that, for any a’ EM, if (AI, a, b, c) E (M, a’, b, c)

then (A4,a, d)dE~ E (A4,a’, d)dE~. We may assume that A4 is w-saturated.

Let N be the

substructure of A4 whose underlying set is the interval (b,c). Then (N, a) and (N,u’) are elementarily equivalent w-saturated structures. Therefore they are back-and-forth equivalent; in other words, in the game in N starting with the partial isomorphism {(u, u’)} the Duplicator has a winning strategy. Since M is an expansion of a linearly ordered set by unary relations, any map from A4 to M, which is the identity outside N and whose restriction on N is a partial isomorphism in N, is a partial isomorphism in M. It follows that (M, a, d)dr~ elementarily equivalent. 0

and (A4,u’,u’)~~A are back-and-forth

equivalent,

and so

Corollary 6.2. The collapse result holds for T,,.

Acknowledgements We are grateful to the late Paris Kanellakis, and also to Michael Benedikt, Jan Van den Bussche, Yuri Gurevich, Leonid Libkin, Charles Steinhorn, and Jianwen Su for helpful comments and suggestions.

References [l] J.T. Baldwin, M. Benedikt, Stability theory, permutations of indiscemibles, and embedded finite models, Preprint, 1991. [2] 0. Belegradek, Y. Peterzil, F. Wagner, Quasi-o-minimal structures, Preprint, 1997. [3] O.V. Belegradek, A.P. Stolboushkin, M.A. Taitslin, On order-generic queries, Technical report 96-01, DIMACS, 1996. [4] O.V. Belegradek, A.P. Stolboushkin, M.A. Taitslin, Generic queries over quasi-o-minimal domains, Logical Foundation of Computer Science, Proc. 4th Intemat. Symp., LFCS’97, Yaroslavl, Russia, July 1997, Lecture Notes in Computer Science, vol. 1234, Springer, Berlin, 1997, pp. 21-32. [5] M. Benedikt, G. Dong, L. Libkin, L. Wong, Relational expressive power of constraint query languages, Proc. 15th ACM Symp. on Principles of Database Systems, 1996, pp. 5-16. [6] A. Chandra, D. Harel, Computable queries for relational databases, J. Comput. System Sci. 21 (1980) 156-178. [7] CC. Chang, H.J. Keisler, Model Theory, 3rd ed., North-Holland, Amsterdam, 1990. [8] J. Flum, M. Ziegler, Pseudo-finite homogeneity and saturation, Preprint, 1997. [9] S. Grumbach, J. Su, Finitely representable databases. Proc. 13th ACM Symp. on Principles of Database Systems, 1994. [lo] S. Grumbach, J. Su, Dense-order constraint databases, Proc. 14th ACM Symp. on Principles of Database Systems, 1995, pp. 66-77. [l l] S. Grumbach, J. Su, C. Tollu, Linear constraint databases, Proc. Logic and Computational Complexity (LCC’94), Lecture Notes in Computer Science, Springer, Berlin, 1995. [12] Yu. Gurevich, Private communication, 1990. [13] W. Hodges, Model Theory, Cambridge University Press, Cambridge, 1993.

0. V. Belegradek et al. I Annals qf Pure and Applied Logic, 97

i 1999) 85-125

125

[14] P.C. Kanellakis, D.Q. Goldin, Constraint programming and database query languages, Proc. Internat. Symp. on Theoretical Aspects of Computer Software (TACS’94), 1994. pp. 966120. [15] P.C. Kanellakis. G.M. Kuper, P.Z. Revesz, Constraint query languages, Proc. 9th ACM Symp. on Principles of Database Systems, 1990, pp. 2999313. [16] P.C. Kanellakis, G.M. Kuper, P.Z. Revesz, Constraint query languages. J. Comput. System Sci. 51 (I ) (1995) 26-52. [17] J.F. Knight, A. Pillay, C. Steinhom. Definable sets in ordered structures, II, Trans. Amer. Math Sot 295 (2) (1986) 593--605. [1X] M. Otto, J. Van den Bussche, First-order queries on databases embedded in an infinite structure. Inform Process. Lett. 60 (1996) 37-41. [19] J. Paradaens, J. Van den Bussche, D. Van Gucht, Toward a theory of spatial database queries. Proc. 13th ACM Symp. on Principles of Database Systems, ACM Press, New York. 1994, pp. 279-2Xx. [20] J. Paradaens, J. Van den Bussche, D. Van Gucht, First-order queries on finite structures over reals. Proc. 10th IEEE Symp. on Logic in Computer Science, IEEE Computer Society Press, Silver Sprmg. MD, 1995, pp. 79987. [21] A. Pillay. C. Steinhom, Definable sets in ordered structures. I, Trans. Amer. Math. Sot. 295 (2) ( 1986) 565-592. [22] A. Pillay, C. Steinhom, Definable sets in ordered structures. III. Trans. Amer. Math. Sot 309 (2) (19X8) 4699476. [23] J. Robinson. Definability and decision problems m arithmetic. J. Symbolic Logic 14 ( 1949) 98 -114. [24] B.I. Rose. R.E. Woodrow, Ultrahomogeneous structures. Zeitschrift fur Mathematische Logik und Grundlagen der Mathematik 27 (I) (1981) 23-30. [25] G.E. Sacks. Saturated Model Theory, Benjammin, Reading, MA. 1972. [26] S. Shelah, Classification Theory and the Number of Non-isomorphic Models. 2rd ed.. North-Holland. Amsterdam, 1990. [27] A.P. Stolboushkin, M.A. Taitslin, Linear vs. order constraint queries over rational databases. Proc 15th ACM Symp. on Principles of Database Systems, 1996. pp. 17-27.