the relational data base model , introduced by codd in  @xcite , has been particularly successful since it is a mathematically elegant model well suited to describe almost all `` real world '' situations .
since the query languages associated to such model ( the _ relational algebra _ and the _ relational calculus _ ) have a formal and simple definition , an interesting field of research is to study the expressive power of such language .
codd  @xcite has proved that the relational algebra is equivalent to the _ relational calculus _ , in the sense that both query languages can compute the same set of relations .    a breakthrough in this field  @xcite has been a syntactic characterization of the set of relations that can be computed in a give data base .
these results , also known as _ bp - completeness _ , are based on the principle of data independency from the physical representation : the information that can be extracted from the data base is completely determined at the logical level of such data base .
this fact can be stated in a simple way : a relation @xmath0 can be computed from a data base @xmath1 if and only if all permutations over the elements of @xmath1 which preserve @xmath1 ( that is , all permutations that produce a data base isomorphic to @xmath1 ) , also preserve @xmath0 .
an interesting interpretation of this property is that only the information given by the structure of the data can be used to differentiate data values ; consequently , a query is expressible if and only if it does not add any additional differentiation to the one initially available  @xcite .
this idea can be rephrased by stating that the result of a query is invariant w.r.t .
permutations of indistinguishable values ; such a permutation was captured with the notion of automorphism in  @xcite .
while the @xmath2-criterion is a natural requirement , it refers to properties of relations in a given data base instead of queries as a whole .
we recall that a query is an expression of the query language that can be applied to different data bases leading to possibly different results .
thus it has been extended to a property of queries as partial functions from data bases to data bases , which is known nowadays as _
@xcite : it has been recognized as the capability of the calculus to preserve isomorphisms between data bases , rather than automorphisms .
genericity is a common requirement for query languages and it is traditionally related to the _ data independence _
principle that assumes that the data base is constructed over an abstract domain which is independent from the internal representation of data .
subsequent research has shown that this approach to the analysis of the expressiveness of a query language has certain shortcomings @xcite , mainly when new data models , such as the object - based model , are introduced .
other notions have been proposed to analyze properties of queries in some new models  @xcite pointing out the importance of extending genericity to be used in more complex models . in  @xcite languages
are classified w.r.t .
the degree of the use of the equality predicate , by analyzing the invariance property of queries under different mappings ( not necessarily isomorphisms ) over the data domain , which are compatible with the relational structure of the data base .
subsequent advances in data base theory have led to different models that take into account the limitations of the relational model when it comes to describe complex situations .
most of such models have been introduced in the graph - based or object - oriented frameworks , but usually their mathematical foundations do not allow a complete study of the expressive power of the query languages introduced .
in fact , to our knowledge , the only exception is the graph - based model good @xcite .    in this paper
we introduce a different syntactic characterization of queries computable in a data base .
our characterization relies upon the notion of partitions of the domain , where each partition represents a level of _ undifferentiation _ among objects , values or vertices .
notice that an automorphism also can represent a certain level of undifferentiation .
initially we will exploit such notion to give two new characterizations of relations expressible in a relational data base .
subsequently , we will show how to apply the new framework to analyze a simple graph - based model , hence proving that our characterization can be useful in comparing the expressive power of different data languages .    following the approach of  @xcite , the data models studied in this paper are domain - preserving , that is , it is not possible to create new vertices or values , but only to query an existing data base . in our framework ,
a binary relation over sets of data values is defined , denoted by @xmath3 , which relates those sets of values that can not be differentiated . from the relation
@xmath3 we build some sets of partitions that _ respect _
@xmath3 , that is , all classes in a partition are preserved by @xmath3 .
we prove that expressiveness of a query language can be stated as the conservation of some of those partitions , where the exact set of partitions that must be preserved depends on the data model .
the expressibility results we obtain have the following form : _ given a data base @xmath1 , let @xmath4 be a relation or a graph over the domain set of @xmath1 .
then @xmath4 can be expressed in @xmath1 if and only if @xmath5 _ , where @xmath6 and @xmath7 are two sets of partitions which depend on the model under consideration .
all sets considered in this paper are assumed to be finite and nonempty .
given a set @xmath8 , a _ relation _ @xmath0 over @xmath8 is a subset of the cartesian product @xmath9 ( @xmath10 times ) for some fixed integer @xmath11 , that is a set of tuples of length @xmath10 , where all components of a tuple are elements of @xmath8 .
the number @xmath12 is called the _ order _ or _ arity _ of the relation . given a set @xmath13 of relations over @xmath8 , the pair @xmath14 is called a _
relational database _ ; in this setting , @xmath8 is the _ domain _ of the database , and @xmath15 is the set of relations of the database .
given a relation @xmath16 of a database @xmath14 , we denote with @xmath17 the _ data domain _ of @xmath0 , that is the subset of the elements of the database domain @xmath8 that are in at least one tuple of @xmath0 . the notion of data domain
is easily extended to the set @xmath15 of relations as the set union of relations data domains : @xmath18 . without loss of generality
, we can assume that @xmath19 for every considered database @xmath14 .
this seemingly trivial requirement is indeed very important , as it will become evident after theorem  [ teo : paredaens2 ] , therefore we will omit the universe set unless it is necessary to avoid any ambiguities .
just as in  @xcite , when referring to a relational database , we use the _ relational algebra _ as a query language . in relational algebra
two binary operators ( union and product ) and three unary operators ( projection , equality restriction and inequality restriction ) are given . in the following definition
all relations are defined over the same database domain @xmath8 .
[ def : relational - algebra ] let @xmath0 and @xmath4 be two relations with the same arity ; the _ union _ of @xmath0 and @xmath4 , denoted by @xmath20 , is simply the set  theoretical union of the two sets of tuples .
given two relations @xmath0 and @xmath4 ( not necessarily with the same arity ) , the ( cartesian ) _ product _ of @xmath0 and @xmath4 , denoted by @xmath21 , is the set of all possible concatenations of a tuple of @xmath0 with a tuple of @xmath4 : @xmath22 .
the abbreviation @xmath23 is used to express the relation @xmath24 ( @xmath25 times ) .
let @xmath26 be the arity of a relation @xmath0 , @xmath27 a positive integer and @xmath28 @xmath29 a function .
the _ projection _ of @xmath0 over @xmath30 , denoted by @xmath31 , is the relation : @xmath32 .
now , let @xmath33 and @xmath34 be two integers such that @xmath35 , where @xmath26 is the arity of a relation @xmath0 .
the _ equality restriction _ of @xmath0 on @xmath33 and @xmath34 is the relation , denoted by @xmath36 , that is obtained by taking from @xmath0 all the tuples for which the @xmath33-th and the @xmath34-th components are equal : @xmath37 .
analogously , the _ inequality restriction _ of @xmath0 on @xmath33 and @xmath34 , denoted by @xmath38 , is the relation obtained by taking from @xmath0 all the tuples for which the @xmath33-th and the @xmath34-th components are different : @xmath39 .
the five operations just described are sufficient to generate the operations of intersection , difference , join and division , usually assumed as primitives in codd s relational algebra ; a proof of this fact can be found , for example , in  @xcite .    given a relational data base @xmath40 , we will denote by @xmath41 the relation which is the result of applying the expression ( of the relational algebra ) e to the data base @xmath1 .
moreover a relation @xmath4 over @xmath8 is told to be _ expressible _ from @xmath15 if there exists an expression @xmath42 whose operands are all relations in @xmath15 , and such that @xmath41 is equal to @xmath4 . following  @xcite ,
we denote with @xmath43 ( basic information contained in the set of relations @xmath15 ) the set of relations that can be expressed from @xmath15 .
as observed in  @xcite , @xmath43 is the set of the answers to all possible queries that can be asked to a relational datmabase that contains the relations @xmath15 . in  @xcite
, paredaens gives a characterization of the class @xmath43 based upon appropriate automorphisms , that is permutations of the elements of the database domain .
let @xmath0 be a relation of order @xmath26 over a set @xmath8 .
as in  @xcite , an _ automorphism _ is a bijective function ( that is , a permutation ) on @xmath8 .
we say that the automorphism @xmath44 _ respects _ the relation @xmath0 or , equivalently , that @xmath45 is @xmath0-_compatible _ if , for each tuple @xmath46 , @xmath47 .
the compatibility of an automorphism @xmath44 with respect to a relation @xmath0 can be naturally extended to a set @xmath15 of relations in the following way : @xmath45 _ respects _ the relations in @xmath15 or , equivalently , @xmath45 is @xmath15-_compatible _ if @xmath45 is @xmath0-compatible for each relation @xmath0 in @xmath15 .
notice that the set of automorphisms @xmath15-_compatible _ , is a group of elements , a binary associative operation on @xmath48 , and an identity element @xmath49 , such that the operation is closed and invertible in @xmath48 ] where the operation is the composition of functions and the identity is the identity function ( i.e. the function defined as @xmath51 ) . as in  @xcite , we denote with @xmath52 the set of all the automorphisms @xmath44 which are @xmath15-compatible ; with a small abuse of notation , if @xmath53 , we will usually write @xmath54 instead of @xmath55 . it will be very useful to consider the following representation of @xmath52 .
let @xmath14 be a relational database , with @xmath56 , @xmath57 , and let @xmath58 be the set of @xmath15-compatible automorphisms .
the following relation of arity @xmath59 : @xmath60 is called the _ cogroup  relation _ of @xmath14 .    as we can see , each row ( tuple ) of the relation @xmath61 represents one of the @xmath15-compatible automorphisms . since we do not associate any particular meaning to the elements of the domain @xmath8 , if @xmath62 we can assume , without loss of generality , @xmath63 .
we can also assume that the first tuple of @xmath61 represents the identity function on @xmath8 ( which is always present in @xmath52 , since it is compatible with every nonempty set of relations ) ; as a consequence , it can always be assumed that the first row of @xmath61 is the tuple @xmath64 .
let @xmath14 be a relational data base , with :    * @xmath65 * @xmath66 , with : @xmath67    it is easily verified that : @xmath68 @xmath69 if we look at the @xmath15-compatible automorphisms as permutations over @xmath8 , we can express @xmath52 as follows : @xmath70 [ ex : klein - group ]    it is not difficult to see that , for a given database @xmath14 , the set @xmath52 of @xmath15-compatible automorphisms is indeed a group with respect to function composition , with the identity function over @xmath8 as unitary element .
in fact , the identity over @xmath8 is always in @xmath52 , the inverse of an @xmath15-compatible automorphism is still an @xmath15-compatible automorphism , and the composition between two @xmath15-compatible automorphisms is again an @xmath15-compatible automorphism . since we can always assume @xmath71
, we can think of @xmath52 as a finite permutation group over the set @xmath72 , that is a subgroup of the symmetric group @xmath73 .
in this paper we investigate the relation between expressive power and partitions of the database domain .
more precisely , we investigate the possibility to characterize the expressive power of relational and graph - based databases via one or more theorems abiding to the following meta theorem .
[ thm : scheme1 ] let @xmath14 be a relational database , and let @xmath4 be a relation over @xmath8
. then @xmath74 , where @xmath75 and @xmath76 are sets of partitions over @xmath8 , built from the sets @xmath15 and @xmath77 of relations respectively .
the relevance of the main result in  @xcite is that it is the first syntactic characterization of the relations that can be obtained from a given database @xmath14 when the relational algebra is used as a query language .
more precisely , in  @xcite the following theorem is proved .
let @xmath14 be a relational database , and let @xmath4 be a relation over @xmath8
. then @xmath78 and @xmath79 .
[ teo : paredaens ]    basically , paredaens has been able to point out the fundamental relation between expressiveness in a database and the set of automorphisms in the relational model .
such result has been successively extended in  @xcite to define in a formal way the notion of _ genericity _ , that is computable queries @xcite have to be invariant with respect to the isomorphisms between databases .
we can restate theorem  [ teo : paredaens ] in a form that will be more convenient for our purposes .
let @xmath14 be a relational database , and let @xmath4 be a relation over @xmath8
. then @xmath80 .
[ teo : paredaens2 ]    first of all , we show that @xmath81 . proving that @xmath82 is trivial as @xmath83 .
the latter stems from the fact that the relations which are expressible from @xmath15 are those obtained from @xmath84 simply ignoring the relation @xmath4 .
let now be @xmath85 and @xmath86 .
if the expression that gives @xmath87 from @xmath84 does contain some occurrence of the relation @xmath4 , it is sufficient to replace such occurrence with the expression that gives @xmath4 from @xmath15 to conclude that @xmath88 , and thus @xmath89 .
it is immediate to notice that @xmath90 implies @xmath91 .    since we have established that @xmath81 , the two databases @xmath14 and @xmath92 are _ basic information equivalent _  that is , every relation of the first database can be obtained from the relations of the second database and vice versa  if and only if @xmath4 is expressible from @xmath14 .
a direct consequence of theorem  [ teo : paredaens ] is that two databases @xmath93 and @xmath94 are basic information equivalent if and only if @xmath95 ( which are assumed to be both equal to @xmath8 ) and @xmath96 ; thus , we can conclude that @xmath80 as stated .
we observe that , given our assumption that @xmath97 , in theorem [ teo : paredaens2 ] we can get rid of the inclusion between the domains , since it is implicit from the fact that @xmath4 is a relation over @xmath8 . on the other hand , we _ can not _ ignore the inclusion condition if we suppose that @xmath98 , since in such a situation it is not difficult to show two relations @xmath0 and @xmath4 such that @xmath99 but @xmath100 .
a notion that seems tightly related to the expressiveness of relations in a database is that of _ indistinguishability _ between elements of the domain . intuitively , the idea is that the elements of a subset of the domain of a given database are indistinguishable if and only if no query to the database is able to divide the set in two parts , one made of the elements that occur in the relation resulting from the query and the other made of the elements that do not occur in the relation .
in such a situation , we say that the set of indistinguishable elements can not be _ separated _ by any of the queries that can be presented to the database .
thus , a relation resulting from a query to the database can only contain all or none of the elements of a non - separable set .    theorem  [ thm : scheme1 ] defines the general framework we propose to investigate the expressive power of query languages . in this framework
different notions of expressible queries can be studied by considering different sets of partitions . for a given database @xmath14 , we say that a set @xmath75 of partitions of @xmath8 is a set of _ valid partitions _ if and only if it satisfies theorem  [ thm : scheme1 ] . by the results in  @xcite
, it seems to us quite natural to define the following sets of valid partitions , namely the _ orbit partitions _ and the _ cycle partitions _ ; indeed later we will be able to prove that , in the context of theorem  [ thm : scheme1 ] , they are equivalent to the characterization of relations obtainable in a relational data base of  @xcite .
let @xmath14 be a relational database , and let @xmath101 , @xmath102 be a partition of @xmath8 .
@xmath103 is an _ orbit partition _ of @xmath8 with respect to @xmath15 if both the following conditions hold :    1 .   for each relation
@xmath16 and for each class @xmath104 , @xmath105 or @xmath106 ; 2 .
for each class @xmath107 and for each pair @xmath108 of elements of @xmath109 there exists an automorphism @xmath110 such that @xmath111 , and @xmath112 for every class @xmath113 .    we denote with @xmath114 the set of all orbit partitions of the given database @xmath14 .
[ def : orbit - partition ]    let @xmath14 be a relational database , and let @xmath101 , @xmath102 be a partition of @xmath8 .
@xmath103 is a _ cycle partition _ of @xmath8 with respect to @xmath15 if both the following conditions hold :    1 .   for each relation
@xmath16 and for each class @xmath104 , @xmath105 or @xmath106 ; 2 .
there exists an automorphism @xmath110 such that for each class @xmath107 and for each pair @xmath108 of elements of @xmath109 there exists an integer @xmath59 such that @xmath115 and @xmath112 for every class @xmath113 .
we denote with @xmath116 the set of all cycle partitions of the given database @xmath14 .
[ def : cycle - partition ]    as already stated for @xmath52 , if @xmath0 is a relation we will write @xmath117 and @xmath118 instead of @xmath119 and @xmath120 respectively .
the following theorem is an alternative formulation of the main result of  @xcite ( the equivalence of the two formulation follows from theorem [ teo : paredaens2 ] ) which is more useful for our purposes .
let @xmath14 be a relational database , and let @xmath4 be a relation over @xmath8 .
then @xmath121 .
let @xmath14 be a relational database , and let @xmath52 and @xmath61 be respectively the group of @xmath15-compatible automorphisms and the cogroup - relation of @xmath15 .
a useful fact proved in  @xcite is that the cogroup - relation is expressible from @xmath15 , that is @xmath122 .
using this fact , we are able to prove the following theorem .    @xmath123 .
[ teo : autr = cgr ]    since @xmath122 , by theorem  [ teo : paredaens ] we can conclude that @xmath124 . now , let @xmath125 ; as we have already observed , @xmath126 is a permutation of the set @xmath97 , as well as of the tuples that compose the relation @xmath61 . thus , for each tuple @xmath127 , we have that @xmath128 . in particular , by letting @xmath59 be the cardinality of @xmath8 , we have : @xmath129 thus , the elements of @xmath8 are mapped by @xmath126 in such a way that the result is a row of the cogroup - relation ; so we can conclude that @xmath110 .    a direct consequence of theorem  [ teo : autr = cgr ] is that not only @xmath122 , as established by paredaens , but also @xmath130 for every relation @xmath16 , since @xmath131 and @xmath132 . as a corollary of theorem  [ teo : autr = cgr ] , if we are interested to study the expressive power of a given relational database @xmath14 then we can work as well on the database @xmath133 , which has only one relation and , moreover , such relation is an explicit representation of the finite permutation group @xmath52 .
we now turn our attention to the structure of @xmath114 and @xmath116 .
first of all we observe that , thanks to theorem  [ teo : autr = cgr ] , we can get rid of item 1 in definitions  [ def : orbit - partition ] and [ def : cycle - partition ] since , by considering the database @xmath134 , there is only one relation and , for such relation , it holds @xmath135 for each @xmath107 .    to characterize the sets of cycle and orbit partitions we need to recall some notions from basic abstract algebra .
let @xmath136 be a set and @xmath137 a group .
action of @xmath48 on @xmath136 _ is a map @xmath138 such that    1 .   @xmath139 ; 2 .
@xmath140    in group theory it is customary to omit the operators symbols from expressions when confusion does not arise ; so , the expression in item 2 above is usually written as : @xmath141 .
let @xmath48 be a group acting on a set @xmath136 .
for @xmath142 , let @xmath143 if and only if there exists @xmath144 such that @xmath145 .
it is not difficult to see that @xmath146 is an equivalence relation on @xmath136 , and thus it induces a partition @xmath103 on @xmath136 .
the classes of @xmath103 are called the _ orbits _ in @xmath136 under @xmath48 . if @xmath147 , the class containing @xmath148  denoted by @xmath149
 is called the _ orbit of _ @xmath148 under @xmath48 . in other words , @xmath150 .
it is not difficult to see that the partition induced by the orbits of @xmath52 on @xmath8 satisfies definition  [ def : orbit - partition ] .
in fact , every automorphism @xmath110 maps each orbit @xmath151 into itself and , given a pair @xmath108 of elements of @xmath8 , there exists an automorphism that maps @xmath152 to @xmath153 if and only if @xmath152 and @xmath153 are in the same orbit .
moreover , if @xmath154 is a subgroup of a group @xmath48 acting on the set @xmath136 , then every orbit @xmath155 is a subset of the orbit @xmath149 ; more precisely , it is not difficult to prove that the orbits induced by @xmath154 are a _ refinement _ of the orbits induced by @xmath48 . since each partition induced by the orbits of every subgroup of @xmath52 satisfies definition  [ def : orbit - partition ] , we have that @xmath114 contains the set of those partitions .
vice versa , let @xmath156 .
it is not difficult to see that the set of automorphisms @xmath110 that map each class of @xmath103 into itself and that map each element of a class to an element of the same class forms a subgroup of @xmath52 ; moreover , the orbit partition induced by such a subgroup is just @xmath103 . as a consequence ,
@xmath114 is a subset of the set of partitions induced by all the subgroups of @xmath52 ; since also the converse inclusion holds , the two sets indeed coincide .
let @xmath48 be a group acting on the set @xmath136 , and let @xmath157 .
for @xmath142 , let @xmath143 if and only if there exists an integer @xmath59 such that @xmath158 , where @xmath159 is the application of @xmath160 for @xmath59 times .
it is not difficult to see that @xmath146 is an equivalence relation on @xmath136 , and thus it induces a partition @xmath103 on @xmath136 .
the classes of @xmath103 are called the _ cycles _ of @xmath160 on @xmath136 .
analogously to what said about orbits , it is not difficult to see that the partitions induced by the cycles of the automorphisms of @xmath52 satisfy definition  [ def : cycle - partition ] .
we observe that , while an orbit partition is induced by a subgroup of @xmath52 , a cycle partition is induced by an automorphism , that is by an element of @xmath52 .
the class @xmath116 is thus the set of cycle partitions obtained by considering every element of @xmath52 .
let @xmath48 be a group acting on the set @xmath136 and let @xmath160 be a permutation in @xmath48 .
then the _ orbits of the _ ( cyclic ) _ group _ @xmath161 generated by @xmath160 are the cycles of @xmath160 .
since @xmath161 is a subgroup of @xmath48 , we have immediately that every cycle partition of @xmath48 is also an orbit partition of @xmath48 , that is , @xmath162 .
example  [ ex : klein - group ] can be used to show that the converse does not generally hold : not every orbit partition is also a cycle partition .
in fact we have : @xmath163    as noted above , theorem  [ teo : autr = cgr ] allows us to deal only with cogroup - relations instead of sets of arbitrary relations .
the same can be done when working with cycle and orbit partitions : since cycles and orbits that form the partitions in @xmath116 and @xmath114 are completely determined from the elements and the subgroups of @xmath52 respectively , by theorem  [ teo : autr = cgr ] we can conclude that @xmath164 and @xmath165 .
it is possible to show that both the set @xmath116 of cycle partitions and the set @xmath114 of orbit partitions of a given database @xmath14 constitute a partially ordered set ( poset ) with respect to the binary relation @xmath166 , where @xmath167 iff each class of @xmath168 is contained in some class of @xmath169 , where @xmath168 and @xmath169 are two partitions in @xmath75 , @xmath75 is equal to @xmath116 or @xmath114 . in fact , it is not difficult to see that @xmath166 is reflexive , antisymmetric and transitive : that is , @xmath166 is an order relation over both @xmath116 and @xmath114 .
one notably difference between the posets @xmath170 and @xmath171 is that the first has always a maximum element , corresponding to the orbits of the entire @xmath52 , while the second may not have a maximum element , as shown above referring to example [ ex : klein - group ] , where @xmath52 is the so called klein group . instead
, both the posets have a minimum element , corresponding to the cycles ( equal to the orbits ) induced by the identity element of @xmath52 : that is , the trivial partition , where each class is a singleton .    in order to prove our main results we need some definitions and some well known properties of finite groups . here
we just recall the notion of _ stabilizer _ ; we address the reader to an introductory book on abstract algebra , such as @xcite , for the notion of coset and its properties .
let @xmath48 be a group acting on a set @xmath136 , and let @xmath147 .
the subgroup @xmath172 of @xmath48 defined as @xmath173 is called the _ stabilizer _ of @xmath148 in @xmath48 .
it is not difficult to see that if @xmath48 is a group which acts on the set @xmath136 , and @xmath147 , then the stabilizer @xmath172 of @xmath148 can be considered as a group which acts on the set @xmath174 .
the following are two well known results in group theory : lagrange s theorem  which correlates the cardinality of a given group @xmath48 and the cardinality of a given subgroup @xmath154 of @xmath48 with the number of left cosets of @xmath48 with respect to @xmath154  and a theorem which expresses the cardinality of the orbit of @xmath48 containing @xmath148 as the number of left cosets of @xmath48 with respect to the stabilizer @xmath172 .
let @xmath48 be a finite group , and let @xmath154 be a subgroup of @xmath48
. then @xmath175 , where @xmath176 is the number of left cosets of @xmath48 with respect to @xmath154 , and is usually called the _ index of @xmath154 in @xmath48_.    let @xmath48 be a finite group acting on a set @xmath136 , and let @xmath147
. then @xmath177 , that is there exists a one - to - one correspondence between the elements of the orbit @xmath149 of @xmath148 under @xmath48 and the left cosets of the stabilizer @xmath172 in @xmath48 .
[ teo : card - orbit ]    we are now able to prove the following theorem .
let @xmath48 be a subgroup of the symmetric group @xmath73 , and let @xmath154 be a subgroup of @xmath48
. if the orbit partitions of @xmath48 and @xmath154 are the same , then @xmath178 .
[ teo : orbit - partitions ]    we prove the assertion by induction on @xmath59 .
for @xmath179 the theorem can be proved by direct inspection of the subgroups of @xmath73 .
now , let us suppose that the theorem is true for @xmath180 , and let us show that it holds also for @xmath59 .
we first observe that since the orbit partitions of @xmath48 and @xmath154 are the same , then also the orbits @xmath181 and @xmath182 of the element @xmath59 with respect to @xmath48 and @xmath154 are the same . now ,
if we take all the partitions having @xmath183 as a class , we get the orbit partitions induced by the stabilizers @xmath184 and @xmath185 of the element @xmath59 with respect to @xmath48 and @xmath154 .
these orbit partitions are equal and thus , by induction hypothesis , @xmath186 . by lagrange
s theorem , we can express the cardinalities of @xmath48 and @xmath154 with respect to the cardinalities of their stabilizers as @xmath187 and @xmath188 .
where @xmath189 and @xmath190 are the indices , respectively , of the stabilizer @xmath184 in @xmath48 and of the stabilizer @xmath185 in @xmath154 . by theorem  [ teo : card - orbit ] , we can infer that @xmath191 and @xmath192 .
since @xmath193 and @xmath194 , we can conclude that @xmath48 and @xmath154 have the same order , and thus @xmath195 .
theorem  [ teo : orbit - partitions ] allows us to show that the orbit partitions of a given database satisfy theorem scheme ii ; in fact , the following theorem provides a first characterization of expressible queries in relational databases alternative to the one originally given by paredaens .    let @xmath14 be a relational database , and let @xmath4 be a relation over @xmath8
. then @xmath196 [ teo : scheme - with - orbits ]    if @xmath197 , since the orbit partitions are completely determined from the subgroups of @xmath52 , we obtain that @xmath198 .    for the converse ,
we observe that @xmath52 is a subgroup of the symmetric group @xmath73 , and @xmath199 is a subgroup of @xmath52 . by hypothesis , the orbit partitions of @xmath52 and @xmath199 are equal and thus , by theorem  [ teo : orbit - partitions ] , @xmath197
.    a second characterization of expressible queries in relational databases can be obtained by considering cycle partitions instead of orbit partitions .
we need the following lemma .
let @xmath48 be a subgroup of the symmetric group @xmath73 , and let @xmath154 be a subgroup of @xmath48 .
if the cycle partitions of @xmath48 and @xmath154 are the same , then also the orbits of @xmath48 and @xmath154 are the same , that is @xmath200 for every @xmath201 .
[ lem : orbits - from - cycles ]    since the orbit @xmath149 is the set of elements of @xmath72 which are reachable from @xmath148 through some element @xmath160 of @xmath48 , while a cycle containing @xmath148 is the set of elements which are reachable from @xmath148 through one element @xmath160 of @xmath48 , one method to build @xmath149 from the cycle partitions of @xmath48 is given by algorithm  [ alg:1 ] .
result @xmath202 @xmath203    algorithm  [ alg:1 ] computes the least subset @xmath204 of @xmath72 which contains @xmath148 and such that , for every cycle partition @xmath103 of @xmath48 , @xmath204 is the union of some cycles in @xmath103 ; it is not difficult to see that @xmath204 is , indeed , the orbit @xmath149 .
since the cycle partitions of @xmath48 and @xmath154 are the same by hypothesis , the orbits computed by the algorithm above will be the same for @xmath48 and @xmath154 , for every choice of @xmath205 .
we are now ready to prove the following theorem .
let @xmath48 be a subgroup of the symmetric group @xmath73 , and let @xmath154 be a subgroup of @xmath48
. if the cycle partitions of @xmath48 and @xmath154 are the same , then @xmath178 .
[ teo : cycle - partitions ]    by lemma  [ lem : orbits - from - cycles ] , the orbits of @xmath48 and @xmath154 are the same . thus we can prove the theorem by the same argument used for theorem [ teo : orbit - partitions ] .
a direct consequence of theorem  [ teo : cycle - partitions ] is that the cycle partitions of a given database satisfy theorem schema ii ; thus , the following theorem provides a second characterization of expressible queries in relational databases alternative to the one originally given by paredaens .
the proof is analogous to the one given for theorem [ teo : scheme - with - orbits ] .
let @xmath14 be a relational database , and let @xmath4 be a relation over @xmath8 .
then : @xmath206 [ teo : scheme - with - cycles ]    a final observation is due about theorems  [ teo : scheme - with - orbits ] and [ teo : scheme - with - cycles ] . even though there is a strong resemblance between our meta theorem  [ thm : scheme1 ] and theorem  [ teo : paredaens2 ] , our results _
can not _ be expressed neither in the form @xmath207 and @xmath208 nor in the form @xmath209 and @xmath79 , as shown in the next example .
let @xmath210 and @xmath211 be two relational databases , with :    * @xmath212 * r = + [ cols="^,^,^,^,^ " , ]     notice that @xmath54 is the cyclic group generated by the permutation @xmath213 , while @xmath214 is the cyclic group generated by the permutation @xmath215 : @xmath216    from @xmath54 and @xmath214 we can easily obtain @xmath217 .
clearly , @xmath4 is not expressible from @xmath0 , since we have @xmath218 but @xmath219 ; on the other hand , @xmath220 and @xmath221 , and @xmath222 and @xmath221 .
the fact that @xmath4 is not expressible from @xmath0 can be correctly determined through orbit partitions or through cycle partitions by observing that : @xmath223 or @xmath224 .
in this section we study a simple graph - based model where two labeled graphs are used to model data bases .
a data base consists of two distinct layers : a _ schema _ layer and a _ structure _ layer ; the objects can be found in the latter , while the former describe the data organization .
each layer is a labeled weakly - connected directed graph , moreover there exists a function that maps a schema into a structure : such function will be called an _ extension_. both vertices and edges of the graphs are labeled , and we can assume that the sets of edge labels and vertex labels , as well as schema labels and structure labels , are disjoint .
an example of data base is represented in figures  [ fig : schema ] ,  [ fig : structure ] , from which it is easy to note how the schema and the structure are closely related , the following definitions only formalize the intuitive idea .            a _
schema graph _ , in short _ schema _ , is a triple @xmath225 , where @xmath226 is an oriented , weakly - connected graph , and @xmath227 , @xmath228 are respectively the injective functions that maps each node ( resp .
edge ) to its label .
[ def_struttura ] a _ structure _ is a triple @xmath229 , with @xmath4 a colored oriented graph @xmath230 , where @xmath231 is the set of _ nodes _ of the structure , @xmath232 is the set of _ edges _ , @xmath233 , @xmath234 are respectively the injective functions that maps each node ( resp .
edge ) to its label , and @xmath235 , is a labeling of the edges over the finite alphabet @xmath236 , called _ coloring _ of the structure .    in the following
, we will use the set @xmath237 of colors that allows to specify that a link between object instances in @xmath238 is actual or not . in the example of fig .
[ fig : structure ] , only the links labeled true are represented , and the presence ( or the abscence ) of links labeled false does not change the data stored in the data base . in fig .  [
fig : false ] is represented a part of the structure , where false links are represented with dotted arrows .
the schema and the structure must be strongly correlated ; in fact there must exist a function , called _ extension _ ( denoted by @xmath239 ) , mapping the schema into the structure . in order to have a sound definition of extension some restrictions
must be enforced , as pointed out in the following definition , where @xmath240 stands for the family of all nonempty subsets of @xmath241 .
informally @xmath239 maps each vertex of the schema into some vertices of the structure and each edge of the schema into some edges of the structure .
[ def_f1 ] let @xmath242 be a schema and @xmath243 a structure , where @xmath244 .
then @xmath238 is an _ extensional structure _ of @xmath245 if there is a function ( the _ extension _ ) from @xmath245 to @xmath238 , @xmath246 , such that : [ condizioni_rel ]    1 .
@xmath247 is a partition @xmath248 of the set @xmath249 , 2
.   for every @xmath250 , the pair @xmath251 iff @xmath252 ;    notice that the first point of the definition of extension implies that the function @xmath253 is well defined . in the following ,
if @xmath238 is the extensional structure of @xmath245 , then we write @xmath254 and we will simply say that @xmath238 is a structure of @xmath245
. given two vertices @xmath255 and @xmath256 of the schema , connected with a link @xmath257 then in the structure there must exist all links @xmath258 for @xmath259 , @xmath260 .
such requirement justifies the introduction of a labeling ( and especially of a true - false labeling ) in order to have a reasonable graph - based model .
[ basedati ] a _ data base _
@xmath261 is a pair @xmath262 , where @xmath245 is a schema and @xmath238 is an extensional structure of @xmath245 .
the schema describes the conceptual organization of the data , while the data content or instantiation of the data base is given by the extensional structure associated to the schema .
it is not hard to notice that , given a schema , there is a one - to - one correspondence between structures and extension functions , therefore we will sometimes use the pair @xmath263 as a data base .
some preliminary definitions are required for introducing our query language .
given a partial function @xmath264 ( i.e. a function where each element of @xmath241 can be associated to one or none of the elements of @xmath261 ) , by @xmath265 we denote the domain of @xmath266 , that is the set of elements @xmath267 such that @xmath268 is defined .
let @xmath269 be two partial functions from the set @xmath241 to the set @xmath270 . then _
@xmath266 is a restriction of @xmath160 _ , denoted by @xmath271 , if @xmath272 and for every @xmath273 , @xmath274 .
moreover by @xmath275 we denote the set obtained as union of all images of elements in @xmath276 : formally @xmath277 .
[ morfi ] let @xmath278 be a data base .
an _ instance _ of @xmath261 is a restriction @xmath266 of @xmath239 such that @xmath265 induces a weakly - connected subgraph of @xmath245 .
the following notations will be used in the rest of the paper .
the set @xmath279 is the set of all instances of @xmath261 .
let @xmath280 be a subset of @xmath279 , then by @xmath281 , we mean the set of nodes of the structure of @xmath261 that is the union of all images of instances in @xmath282 , while @xmath283 is the union of all domains of instances in @xmath282 .
an element in @xmath284 is called a _ value _ , while an element in @xmath285 is called a _
name_. then the image of a name @xmath286 is the subset @xmath241 of @xmath284 such that @xmath287 . for a value @xmath288 ,
the _ inverse image of @xmath289 _ , denoted by @xmath290 , is the name of @xmath285 that is mapped by @xmath239 , to a set containing the element @xmath289 .
similarly , given a set @xmath241 of values , the _ inverse image of @xmath241 _ is the set @xmath291 which is union of all inverse images of the values in @xmath241 .
our graph data model is proposed as a domain - preserving data base , along the same lines as other papers where the expressiveness of the relational algebra is studied  @xcite , and it gives a formal embedding for languages used for the retrieval of graph - structured information  @xcite .
the requirement that we are dealing with domain - preserving data bases reflects in the query language : in fact we have no operation for creating new elements or modifying the schema graph , and all operations must preserve the schema and the original structure .    the main consequence of the assumption that our model is domain preserving consists in the fact that we will deal with a schema which is mapped to an instance through an extensional mapping .
therefore there is a complete equivalence between subgraphs of the structure and restrictions of the extensional mapping .
we are now able to introduce the operations of our graph algebra : according to our reasoning above we can describe the operation as over partial functions whenever it allows a simpler formulation .
[ sovrapposizione ] let @xmath292 be a data base and let @xmath293 .
the _ addition _ of @xmath294 and @xmath295 , denoted as @xmath296 , is the following function over domain @xmath297 .
the operation is defined only if @xmath298 : @xmath299    [ prodotto ] let @xmath292 be a data base , and let @xmath300 be two functions in @xmath279 .
the _ product _ of @xmath294 and @xmath295 , denoted as @xmath301 is the instance in @xmath279 defined as follows :    @xmath302 the product is defined only if @xmath303 induces a weakly - connected subgraph of @xmath245 .
[ proiezione ] let @xmath292 be a data base .
let @xmath266 be a function in @xmath279 and let @xmath241 be a subset of the domain of @xmath266 , such that @xmath241 induces in @xmath245 a weakly - connected subgraph .
the _ projection of @xmath266 on @xmath241 _ , denoted as @xmath304 , is the instance defined as follows :    @xmath305    [ differenza ] let @xmath292 be a data base .
let @xmath300 be two functions in @xmath279 over the same domain @xmath241 .
the _ difference of @xmath294 by @xmath295 _
, denoted as @xmath306 is the following instance :    @xmath307    the difference is defined only if @xmath308 induces a weakly - connected subgraph of @xmath245 .
since the coloring of the edges encodes the fact that a relation between two objects is actual or not , it is natural that the query language has some tools for exploiting such coloring . in our model
we will need to extract instances where `` similar '' edges are the same color .
the definition of _ selector _ is the first step in such direction .
let @xmath245 be the schema of a data base @xmath261 .
then a _ selector of @xmath245 _ is a pair @xmath309 consisting of a weakly - connected subgraph @xmath48 of @xmath245 and a coloring @xmath310 of the edges of @xmath48 .    querying for a selector in a data base returns all subgraphs of the structure that are isomorphic to the selector : each such subgraph is indeed called a _
simple instance_. moreover , it is natural to define an operation of selection that allows to obtain instances which are compatible with a coloring of the schema over the alphabet @xmath236 .
this is the last operation of our algebra .
[ simple ] let @xmath263 be a data base , where @xmath311 .
let @xmath312 be a selector of @xmath245 , where @xmath313 .
then a _ simple instance induced by the selector @xmath314 _ is a restriction @xmath266 of @xmath239 such that @xmath315 , @xmath316 for each @xmath317 and @xmath318 for each @xmath319 .
notice that all simple instaces have the same domain .
[ selezione ] let @xmath292 be a data base .
let @xmath266 be a function in @xmath279 and @xmath314 a selector .
let @xmath320 be the set of all simple instances induced by @xmath321 that are also subinstances of @xmath266 .
the _ selection of @xmath322 by @xmath314 _
, denoted as @xmath323 , is @xmath324 .
given a set @xmath280 of instances , our first aim is to give a characterization of all instances that can be obtained with a query that uses only the information contained in the instances in @xmath280 , or equivalently by an expression of the algebra that has only instances in @xmath280 as operands . in such direction
the main result of this section is that expressiveness in our graph algebra is equivalent to the conservation of a certain partition .
it is natural to associate a notion of _ undistinguishability _ to a partition , where all elements in a set of the partition are deemed undistinguishable .
we share the goals of  @xcite , but we have introduced in this paper a new framework , that is we are looking for a notion of expressiveness that is coherent with our meta theorem . just as the notion of _ automorphisms _ , introduced in  @xcite for relations , gives a global description of the logical dependencies among data that must be preserved when querying the data base , in our model a partition ( or an equivalence relation ) will represent all such logical dependencies .
the equivalence partition over elements of the structure that we will study is called _ stability _ and is denoted by @xmath325 ( where @xmath326 is an instance ) .
the simplest possible form of undifferentiation ( called _ 0-stability _ ) is based on the idea that we are able to distinguish images of different vertices of the instance and vertices of the extensional structure belonging to different functions of @xmath326 .
such notion basically consists of using expressions in our algebra that do not contain any selection .
[ def : split ] let @xmath241 be a subset of the image of a set @xmath282 of instances .
then @xmath241 is _ split _ by @xmath282 iff there is a function @xmath327 in @xmath282 such that @xmath328 and @xmath329 .
we are now able to introduce formally the definition of 0-stability , as follows :    [ 0-stable ] let @xmath282 be a set of instances over a data base @xmath262 , and let @xmath241 be a subset of @xmath281 . then @xmath241 is _
0-stable _ w.r.t .
@xmath280 , if the two following conditions hold :    1 .
@xmath330 , where @xmath331 , and @xmath332 is a name of the schema .
2 .   for each function @xmath333
, then @xmath241 and @xmath334 are disjoint or one is contained into the other one .    a more refined notion of undifferentiation is called _
@xmath335-stability _ ; informally a set @xmath241 is 1-stable w.r.t . @xmath261
if @xmath241 is 0-stable and @xmath261 is not able to distinguish two vertices of @xmath241 with edges outgoing from @xmath261 and ingoing in @xmath241 ( or outgoing from @xmath241 and ingoing in @xmath261 ) .
notice that 1-stability is a binary relation over subsets of @xmath284 , while 0-stability is a unary relation .
the formal definition is :    [ un_passo ] let @xmath282 be a set of instances over a data base @xmath262 and let @xmath241 and @xmath261 be two disjoint subsets @xmath281 . then @xmath241 is _
1-stable _ w.r.t .
@xmath261 and @xmath280 , denoted as @xmath336 if the following conditions are verified :    1 .
@xmath241 is 0-stable w.r.t .
@xmath282 ; 2
.   for each edge @xmath337 of @xmath338 , with @xmath339 and for each @xmath340 there exists @xmath341 such that @xmath342 ; 3 .   for each edge @xmath343 of @xmath338 , with @xmath339 and for each @xmath340 there
exists @xmath341 such that @xmath344 .
informally 1-stability means that whenever there is an colored edge ( say a red edge ) from a vertex of @xmath241 to a vertex of @xmath261 , then all vertices of @xmath241 have a red edge ingoing in @xmath261 . in other words
if we assume that @xmath261 is undistinguishable , then also @xmath241 is undistinguishable , by any single - edge path .
the notion of 1-stability can be further generalized , but first we need a new definition .
[ cammino ] let @xmath345 be a labeled graph .
then a _ colored path _ in @xmath48 is a pair @xmath346 where @xmath347 , and for every @xmath348 , @xmath349 belongs to @xmath231 and @xmath350 is an edge of @xmath48 such that @xmath351 or @xmath352 .
moreover @xmath353 is the sequence @xmath354 where @xmath355 is the color of the edge @xmath350 in @xmath48 .
notice that the definition of path used in the paper is different from the one that can be usually found in a graph theory textbook , as arcs can also be in the reverse direction .
the _ length _ of a path is the number of edges it contains .
let @xmath356 be a data base and let @xmath346 be a colored path of @xmath338 , with @xmath357 .
then the _ path schema _ of @xmath346 is the pair @xmath358 , with @xmath359 , where for every @xmath360 , @xmath361 and @xmath362 .
[ path - dependencies ] let @xmath363 be two nodes of the @xmath280-structure , and let @xmath364 be a subset of @xmath281 , then the _ path dependencies _ from @xmath148 to @xmath289 in @xmath364 , denoted as @xmath365 is the set of path schemata of all paths of the @xmath280-structure that are starting in @xmath148 and ending in @xmath289 and entirely contained in @xmath364 .    informally given @xmath366 , their path dependencies is obtained by removing all vertices not in @xmath364 , then computing all possible paths from @xmath148 to @xmath289 , and finally computing the respective path schemata .
the next step is to generalize 1-stability to @xmath25-stability , that is taking into account length-@xmath25 paths instead of simple edges ( that is length-1 paths ) .
[ k_passi ] let @xmath282 be a set of instances over a data base @xmath262 , let @xmath25 be an integer larger than one , and let @xmath241 and @xmath261 be two disjoint subsets of @xmath281 .
then @xmath241 is _
@xmath25-stable _ w.r.t .
@xmath261 and @xmath280 , denoted as @xmath367 if the following conditions are verified :    1 .
@xmath241 is 0-stable w.r.t .
@xmath282 ; 2 .
@xmath241 is @xmath368-stable w.r.t . @xmath261 and @xmath280 ; 3
.   for each @xmath369 there exists @xmath341 such that @xmath370 .
the main idea is that when @xmath367 then if @xmath261 is undistinguishable also @xmath241 is undistinguishable when only paths no longer than @xmath25 are taken into account .
our main definition follows :    [ rel_collettiva ] let @xmath280 be a set of instances , and let @xmath371 be two disjoint subsets of @xmath281 . then @xmath241 is _ stable w.r.t . @xmath261 _ in @xmath280 , denoted as @xmath372 , if @xmath373 for all @xmath374 .    by def .
[ rel_collettiva ] , it is immediate to verify the following properties of stability :    [ prop1_rel ] let @xmath280 be a set of instances , and let @xmath375 , then :    1 .   if @xmath376 and @xmath377 , then @xmath372 and @xmath378 , 2 .
if @xmath379 , @xmath372 and @xmath378 , then @xmath380 , 3 .
if @xmath379 , @xmath381 , @xmath382 and @xmath383 , then @xmath384 .
stability is a relation between disjoint subsets of the domain .
the definition of expressiveness in the query language that we want to obtain is based on partitions , and now we are able to introduce the class of partitions we are interested into .
a partition @xmath385 of nodes of the structure is called _ valid _ if and only if for each set @xmath241 of the partition and every set @xmath261 that is a union of sets of @xmath385 , then @xmath261 can not differentiate @xmath241 .
[ partizione_accettabile ] let @xmath280 be a set of instances .
a partition @xmath386 of @xmath387 is _ valid _ if for every @xmath388 , then @xmath389 .
given a set @xmath282 of instances , then there may be various valid partitions of @xmath281 , and at least one valid partition always exists ( the partition where each vertex of the extentional structure is a set ) .
some valid partitions are more representative of the actual undifferentiation , in fact we will assume as a measure of the undifferentiation induced by @xmath280 the coarsest valid partition , which we will call _ canonical partition _ and denote as @xmath390 .
we can show that the definition of canonical partition is well - formed .
every set @xmath280 of instances has a unique canonical partition @xmath390 .
clearly the partition of @xmath281 into singletons is a valid partition , so there exists at least one canonical partition .
now assume to the contrary that there exist two coarsest valid partitions @xmath391 and @xmath392 .
let @xmath393 and @xmath394 be the equivalence relations induced by the partitions @xmath391 and @xmath392 , respectively .
let @xmath395 be the transitive closure of the relation @xmath0 defined as follows : @xmath396 if and only if @xmath148 and @xmath289 are in the same set of @xmath391 or @xmath392 .
we can prove that the partition @xmath385 induced by @xmath395 is a valid one of index strictly less than @xmath25 . by construction of @xmath395
each set of @xmath385 is a union of sets in @xmath391 and also a union of sets in @xmath392 , moreover each set in @xmath385 is contained in the image of a single name ( since each set must be 0-stable ) .
notice that @xmath397 iff @xmath398 .
let @xmath399 be a set of @xmath385 , and let @xmath400 be a class of @xmath391 contained in @xmath399 .
since @xmath391 is a valid partition , and @xmath399 is a union of disjoint sets of @xmath401 , by lemmata  [ rel_collettiva ] ,  [ prop1_rel ] , we have that @xmath402 and @xmath403 .
let @xmath399 , @xmath404 be two sets of @xmath385 , with @xmath405 and @xmath406 .
we have already proved that @xmath407 and @xmath408 , applying again lemmata  [ rel_collettiva ] ,  [ prop1_rel ] and noting that @xmath406 we obtain @xmath409 , by the generality of @xmath399 and @xmath404 the partition @xmath385 is valid .
moreover @xmath385 is coarser than @xmath401 , which is a contradiction .
in this section we will prove our main result regarding the expressiveness of the graph - based query language by showing that a function can be computed if and only if adding such function does not change the canonical partition . in the following
we will assume that the union of the images of all functions in @xmath326 is exactly the universe set ; such assumption does not violate the generality since otherwise we would simply have some sets of the canonical partition whose union consists of exactly those elements of the universe set that are not in any function in @xmath326 .
[ graal - expressivess ] let @xmath410 be the set of functions that are a result of an expression of the graph algebra where only functions of @xmath280 are operand .
then @xmath411 if and only if the canonical partition induced by @xmath280 is equal to the canonical partition induced by @xmath412 , that is @xmath413 .
the following two properties , that are consequences of def .  [ partizione_accettabile ] , will be useful to prove the main result of the paper .
[ f_1 ] let @xmath280 be a set of instances and let @xmath385 be a valid partition .
then the image of every instance @xmath414 is the union of sets of @xmath385 .
we prove the lemma by induction on the number @xmath59 of operations of the expression for @xmath415 . if @xmath416 , then @xmath415 is a function in @xmath417 .
since all sets of a valid partition are @xmath418-stable , no set of a valid partition has both an element in @xmath419 and an element not in @xmath419 , therefore the union of all sets of @xmath385 that are contained in @xmath419 is contained in @xmath419 . to prove that such containment is not strict ( i.e. such union is equal to @xmath419 ) it is sufficient to note that all elements of @xmath419 belong to some set of @xmath385 .
assume now that @xmath420 and @xmath415 is obtained by the application of an operation to two expressions @xmath421 and @xmath422 in @xmath410 , or one expression for a selection . clearly , by inductive hypothesis
the images of @xmath421 and @xmath422 are obtained as the union of some sets of @xmath385 .
it is immediate to verify the lemma for the case that @xmath423 , @xmath424 , @xmath425 and @xmath426 .
finally , assume that @xmath427 , where @xmath321 is a selector .
by definition of the selection , then @xmath419 is the union of the images of all simple instances induced by @xmath321 .
assume to the contrary that there exists a set @xmath241 of the valid partition such that @xmath428 and @xmath429 .
now , let @xmath430 and @xmath431 .
hence , by construction of selection , @xmath289 can not be in the image of any simple instance induced by @xmath321 , while @xmath148 is contained in the image of a simple instance induced by @xmath321 . by inductive hypothesis @xmath432
is union of sets of @xmath385 , moreover since @xmath241 is a set of @xmath385 , also @xmath433 is union of sets of the valid partition , implying that @xmath434 , it follows that , for each @xmath435 , @xmath436 for some @xmath437 .
this implies that there is a simple instance induced by @xmath321 that has in its image @xmath289 , which is a contradiction with the above assumption .
consequently , the image of @xmath415 must be union of sets of @xmath385
.    we will prove that an alternative characterization of canonical partition is as the partition induced by the equivalence relation @xmath438 between elements of @xmath439 , where @xmath440 if and only if for every instance @xmath441 , @xmath442 . in the following of the paper
let @xmath443 denote the partition induced by the equivalence relation @xmath438 .
successively we will prove that a function @xmath322 belongs to @xmath410 if and only if @xmath275 can be obtained as union of sets of @xmath443 , completing the proof of our main result , in two steps .
first we will prove that a function @xmath266 belongs to @xmath444 if and only if @xmath445 is union of sets in @xmath443 , then we will prove that @xmath446 .
the following proposition is an immediate consequence of the definitions of @xmath440 and of projection .
[ unique1 ]
let @xmath447 such that @xmath440 .
then both @xmath148 and @xmath289 belong to the set @xmath448 for some name @xmath449 .
[ unique ] let @xmath450 be the partition induced by a set @xmath280 of instances . then , the inverse image of every set of the partition consists of a single vertex .
[ minimo_ottenibile ] let @xmath280 be a set of instances over @xmath261 , let @xmath443 be the partition induced by @xmath282 , and let @xmath451 .
then there exists an instance @xmath441 such that @xmath452 .
let @xmath453 be the set of functions @xmath454 such that @xmath455 . by cor .
[ unique ] all functions in @xmath453 have the same domain , therefore the expression @xmath456 is well - formed ; by construction @xmath457 . by definition of @xmath443
all functions @xmath458 are such that @xmath459 or @xmath460 , therefore all functions @xmath458 whose image intersect @xmath241 are such that @xmath455 , which in turn implies that are also in @xmath453 .
hence @xmath461 , for otherwise there would be an element of @xmath241 not belonging to the image of any function in @xmath326 .
[ uni2 ] let @xmath326 be a set of instances over @xmath261 , let @xmath450 be the partition induced by @xmath282 and let @xmath241 be a union of sets in @xmath443 , such that the inverse image of @xmath241 induces a weakly - connected subgraph of the schema , then @xmath241 is the image of an instance @xmath441 .
let @xmath462 be the sets of @xmath443 whose union is @xmath241 , and notice that , by lemma  [ minimo_ottenibile ] , it is possible to associate to each set @xmath463 the instance @xmath464 whose image is @xmath463 , moreover for each such @xmath465 , @xmath466 . for each vertex @xmath148 in the inverse image of @xmath241 we can construct the function @xmath467 as @xmath468 . then let @xmath469 ; it is immediate to note that @xmath461 .    an immediate consequence of lemmata  [ f_1 ] and  [ uni2 ] is the following :    [ canonical = obtainable ]
let @xmath326 be a set of instances over @xmath261 and let @xmath333 .
then @xmath470 if and only if @xmath445 is union of sets in @xmath443 and the inverse image of @xmath445 induces a weakly - connected subgraph of the schema .    with lemma  [ uni2 ]
we have proved that all interesting unions of sets of the partition @xmath450 can be obtained with an expression of the graph algebra where all operands are taken from @xmath280 , therefore @xmath450 conveys all expressibility information . but @xmath450 is defined on the set @xmath410 , we still need to correlate the definition of canonical partition with that of @xmath450 .
[ pbi_accettabile ] let @xmath280 be a set of instances .
then @xmath450 is a valid partition of @xmath280 .
let @xmath371 be two disjoint sets where @xmath471 and @xmath261 is union of sets in @xmath443 , we will prove that @xmath372 .
first of all we will show that @xmath241 is 0-stable .
remember that , by definition of @xmath443 , for each @xmath470 either @xmath472 or @xmath473 .
since @xmath474 contains @xmath326 , it is immediate to not that @xmath241 is 0-stable . in the following
let @xmath10 be the single - vertex inverse image of @xmath241 .
if the inverse image of @xmath475 does not induce a weakly - connected subgraph of the instance , then 0-stability of @xmath241 suffices to prove that @xmath372 , therefore assume that the inverse image of @xmath475 induces a weakly - connected subgraph of the instance .
let us assume that @xmath372 does not hold , then we will get a contradiction . without loss of generality we can assume that @xmath261 is a minimum set for which @xmath372 does not hold .
the new assumption implies that @xmath25-stability does not hold for some @xmath25 .
it follows that there are two elements @xmath476 and an element @xmath477 such that @xmath478 is not contained in @xmath479 , for every @xmath480 .
now , by lemma  [ uni2 ] , there is an instance @xmath414 such that @xmath481 .
let @xmath482 and @xmath483 and let @xmath480 such that @xmath484 . let us consider the function @xmath485
. by construction @xmath148 belongs to @xmath486 , but @xmath289 does not ; since @xmath487 we have found a function in @xmath474 containing @xmath148 but not @xmath289 , contradicting the assumption that @xmath488 .
[ pd = pbi ] let @xmath280 be a set of instances . then @xmath489 .    by lemma  [ pbi_accettabile ] , @xmath490 must be a valid partition of @xmath280 . by lemma  [ minimo_ottenibile ] ,
every set @xmath491 is obtained as the image of some instance @xmath441 . clearly , since @xmath441 , by lemma  [ f_1 ] the image @xmath241 of @xmath322 is the union of sets of the canonical partition of @xmath280 .
hence @xmath492 .
[ uguale1 ] let @xmath280 be a set of instances
. then an instance @xmath415 belongs to @xmath474 if and only if @xmath493 .    clearly by lemma  [ pd = pbi ] it suffices to show that @xmath414 if and only if @xmath494 , moreover it is immediate to note that , by construction of @xmath443 , if @xmath414 then @xmath494 .
assume now that @xmath494 .
by lemma  [ pbi_accettabile ] , @xmath495 must be a valid partition . by lemma  [ f_1 ] , and exploiting the assumption that @xmath496 , for each @xmath497 , @xmath498 must be the union of some sets in @xmath499 , that is @xmath500 , for some sets @xmath501 .
but by lemma  [ minimo_ottenibile ] , for each set @xmath502 there is an instance @xmath503 such that @xmath502 is the image of @xmath504 .
consequently , @xmath505 , and hence @xmath506 , which proves that @xmath414 as required .
theorem  [ uguale1 ] and lemma  [ pd = pbi ] lead to our main result .
[ cor : uguale1 ] let @xmath280 be a set of instances
. then an instance @xmath415 belongs to @xmath474 if and only if @xmath507 .
we have introduced the idea that partitions of the domain set can be used for characterizing the set of relations or graphs that can be extracted in a data base in the relational or in a graph - based model .
by formally proving those expressiveness results we have effectively given a new framework for the analysis of data base query languages .
s.  abiteboul , c.  beeri , m.  gyssens , and d.  van gucht .
an introduction to the completeness of languages for complex objects and nested relations . in _ nested relations and complex objects _ ,
volume 361 of _ lncs _ , pages 117138 , 1989 .
m.  andries and j.  paredaens . a language for generic graph transformations . in _
graph - theoretic conecpts in computer science , 17th international workshop , wg91 _ , volume 570 of _ lncs _ , pages 170183 , berlin , 1991 .
springer - verlag .    f.  bancilhon . on the completeness of query languages for relational data bases . in _
proceedings , 7th symp . on mathematical foundations of computer science _ ,
volume  64 of _ lncs _ , pages 112123 , berlin , 1978 .
springer - verlag .                    j.  van den bussche , d.  van gucht , m.  andries , and m.  gyssens . on the completeness of object - creating query languages . in _
33rd annual symposium on foundations of computer science .
proceedings _ , pages 372379 , 1992 .