<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Bag Equivalence of Bounded Symmetry-Degree Conjunctive Queries with Inequalities</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mingmin Chen</string-name>
          <email>chenmi@cs.ucdavis.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Todd J. Green</string-name>
          <email>green@cs.ucdavis.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science University of California</institution>
          ,
          <addr-line>Davis Davis, CA 95616</addr-line>
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We consider the problem of checking equivalence of conjunctive queries with inequalities under bag (multiset) semantics. The problem is known to be decidable in pspace and as hard as graph isomorphism, but its exact complexity remains open. We introduce a natural restriction based on what we call the symmetry degree of queries, and show that when the symmetry degree is bounded by a fixed polynomial in the size of the query, the equivalence problem is in Π2p. We also show that for asymmetric queries (those of symmetry degree 1), checking bag-equivalence is polynomial-time Turing equivalent to the graph automorphism problem. These results can be interpreted as first steps in a more general program of finding “islands of tractability” for testing equivalence of conjunctive queries with inequalities under bag (rather than set) semantics.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        We study the problem of checking equivalence of conjunctive queries (CQs) with
built-in inequality predicates over a densely-ordered domain under bag (multiset)
semantics. This problem is well-understood assuming the classical set semantics,
where it is known that the complexity jumps from NP-complete for ordinary
CQs [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] to Π2p-complete when inequalities are allowed [
        <xref ref-type="bibr" rid="ref23 ref29">23, 29</xref>
        ]. For bag semantics
(implemented by most DBMSs, and hence of practical as well as theoretical
interest), the problem is comparatively less-well understood: it is known to be
as hard as graph isomorphism [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and decidable in pspace [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ], but the exact
complexity is unknown (and seems to be difficult to resolve).
      </p>
      <p>
        In this paper, we introduce a natural restriction on the structure of CQs called
bounded symmetry degree (a bound on the number of query automorphisms)
and use this notion to study the complexity of the bag equivalence problem.
The notion is adapted from the well-known concept of graph symmetry studied
extensively in the graph theory literature [
        <xref ref-type="bibr" rid="ref17 ref18 ref21 ref25">17, 21, 25, 18</xref>
        ]. We show that if the
symmetry degree of CQs with inequalities is bounded, then bag equivalence can
p
be decided in Π2 (and we also show that checking for bounded symmetry degree
can be done in Π2p). In fact, we show this holds even when we relax the restriction
to allow queries of polynomially bounded symmetry degree (see Section 3.1). We
also consider several stronger forms of symmetry degree bounds, and establish
that for asymmetric CQs, bag equivalence of CQs with inequalities reduces to
checking graph automorphism, while a bound on the number of self-joins in the
queries yields a coNP upper bound. We also compare the notion of bounded
symmetry degree with the standard notion of bounded hypertree width, which
turns out to be orthogonal and not obviously applicable to the setting of bag
semantics. These results may be interpreted as first steps in a more general
program of finding “islands of (relative) tractability” for testing equivalence of
CQs with inequalities under bag (rather than set) semantics.
      </p>
      <p>Outline. Section 2 contains preliminaries and a discussion of related work.
Section 3 defines the notion of bounded symmetry degree, establishes some basic
results, and compares it with bounded hypertree width. Section 4 presents the
main results on equivalence, for bag and bag-set semantics. We conclude in
Section 5. The Appendix contains formal proofs of our results.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries and Related Work</title>
      <p>
        Conjunctive queries with inequalities. Following the standard terminology [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ],
a conjunctive query (CQ) is a safe, nonrecursive datalog rule whose body is a
conjunction of relational atoms. A conjunctive query with inequalities (CQ&lt;) is
a conjunctive query extended with a conjunction of inequality atoms using &lt;, ≤,
and 6=. We use uppercase letters for predicate symbols, x, y, z, . . . for variables,
a, b, c, . . . for constants, and t, u, v, . . . for variable or constant terms, with
overbars x¯, a¯, t¯, etc. indicating lists. We write a CQ&lt; Q as Q(x¯) :– R, C where R,
the relational part, is a conjunction of relational atoms and C, the conditions, is
a conjunction of inequalities x θ t, θ ∈ {&lt;, ≤, 6=}. We denote by QR the CQ
obtained from Q by deleting C. For example, if Q is Q(x, y) :– T (x, y), S(x, y), x &gt;
y, y 6= 2, then QR is QR(x, y) :– T (x, y), S(x, y).
      </p>
      <p>Semantics of queries. We fix a densely-ordered domain of constants which, for
concreteness, we will assume is that of the rationals Q. A set relation of arity k is
a finite set R of tuples from Qk. A bag (multiset) relation of arity k is a mapping
R : Qk → N of tuples to their associated multiplicities, where the mapping is
non-zero on only finitely many tuples. A set (resp., bag) database instance I is
an assignment of set (resp., bag) relations RI to predicate names R.</p>
      <p>The semantics of CQ&lt;s on set and bag relations is based on the notion of
valuations. A valuation is mapping ν of variables to constants, extended to map
constants to themselves. Valuations operate pointwise on lists/tuples and atoms
in the expected way. Let Q be a CQ Q(t¯) :– R1(t¯1), . . . , Rn(t¯n), C and let I be
a set instance. The result of evaluating Q on I under set semantics is the set
relation JQKI defined</p>
      <p>JQKI = {ν(t¯) | ν |= C and ν(t¯1) ∈ R1I ∧ · · · ∧ ν(t¯n) ∈ RnI}
Now suppose I is a bag instance. The result of evaluating Q on I under bag
semantics is the bag relation JQKbI defined</p>
      <p>JQKbI (a¯) = X(R1I(ν(t¯1)) × · · · × RnI(ν(t¯n)))</p>
      <p>ν
where the sum is over all valuations ν such that ν(t¯) = a¯ and ν |= C. Finally,
suppose I is a set instance. The result of evaluating Q on I under bag-set
semantics is the bag relation JQKbIs obtained by viewing I as a (duplicate-free) bag
relation, and evaluating Q on I under bag semantics.</p>
      <p>
        A CQ&lt; Q is satisfiable (or consistent [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ]) if there exists a set (or,
equivalently, a bag) database instance I such that JQKI 6= ∅. Every CQ is satisfiable,
and a CQ&lt; is satisfiable iff its comparison part is satisfiable. The latter can be
checked in linear time using an algorithm in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Here, we focus only on satisfiable
queries, and we do not allow equality atoms x = t (since, for satisfiable queries,
such atoms can always be eliminated by replacing each occurrence of x with t).
Containment mappings and isomorphisms. Let Q(x¯) :– R, C and Q′ (x¯′ ) :– R′ , C′
be two CQ&lt;s, and denote by V (Q) and V (Q′ ) the sets of variables and constants
that occur in Q and Q′ , respectively. A containment mapping [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (or
homomorphism) from Q′ to Q is a mapping h : V (Q′ ) → V (Q), lifted to operate on atoms
and conjunctions of atoms in the obvious way, such that:
1. h(t¯′ ) = t¯.
2. h is the identity mapping on constants.
3. h(R′ ) ⊆ R.
4. C |= h(C′ ), i.e. C |= h(a′ ) θ h(b′ ) if a′ θ b′ is in C′ where θ ∈ {&lt;, ≤, 6=}
A homomorphism h is called an isomorphism if h is bijective and its inverse is
also a homomorphism. Note that Q, Q′ are isomorphic via mapping h iff QR and
Q′ R are isomorphic and C and C′ are logically equivalent modulo h. Given a
candidate isomorphism mapping, the latter condition can be checked by comparing
the transitive closures of C and C′ (see Appendix for details).
      </p>
      <p>An endomorphism (resp., automorphism) is a homomorphism (resp.,
isomorphism) from a CQ&lt; to itself. For a CQ&lt; Q, the set of automorphisms of QR,
denoted by Aut(QR), forms a subgroup of the symmetric group on V (Q). The
identity element in this group is the identity mapping. Similarly, the set of
endomorphisms of QR, denoted by End(QR), forms a monoid.</p>
      <p>
        Linearizations and linear expansions. We use the notions of linearizations and
linear expansions of CQ&lt;s due to Nutt et al. [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ], which are based on the
standard notion of linear extensions for partially ordered sets. Let C be a set of
inequalities (&lt;, ≤, 6=) over a set T of variables and constants. A linearization of
C is a total order L over T that is compatible with C. (Note that L may equate
distinct variables, when this is allowed by C.)
      </p>
      <p>If L is a linearization of C, and C is the condition of a CQ&lt; Q, then we
denote QL the CQ&lt; obtained from Q by replacing C with L, and we say that
QL is a linearization of Q. By default, we do not eliminate equalities in
linearizations unless explicitly pointed out. (Thus, the condition for a linearization is a
conjunction of inequalities of the form x θ t, θ ∈ {&lt;, =}.) The linear expansion
of Q is the bag lin(Q) of all linearizations of Q (it can be viewed as a union of
CQ&lt;s). We say that linear expansions lin(Q) and lin(Q′ ) are isomorphic if there
is a bijection f : lin(Q) → lin(Q′ ) such that QL is isomorphic to f (QL) for every
QL ∈ lin(Q).</p>
      <p>
        Known results on equivalence. The equivalence problem for conjunctive queries
with or without inequalities under set semantics, bag semantics, bag-set
semantics have been studied extensively, beginning with the seminal paper by
Chandra and Merlin [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] which established the NP-completeness of checking
containment/equivalence of CQs under set semantics using a characterization in terms
of containment mappings. Containment/equivalence of CQ&lt; queries was shown
to be in Π2P by Klug [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] and Π2P -hard by van der Meyden [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ].
      </p>
      <p>
        The papers by Chaudhuri and Vardi [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and Ioannidis and Ramakrishnan [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]
initiated the study of query containment and equivalence under bag/bag-set
semantics. The former paper showed that two CQs are bag-equivalent iff they are
isomorphic, which yields a logspace equivalence of the problem with the graph
isomorphism problem (GI). The latter paper showed that containment of unions
of CQs is undecidable via a reduction from Hilbert’s Tenth Problem. The
decidability of bag containment of CQs remains an open problem. (A recent paper
by Afrati et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] gives positive decidability results for certain classes of CQs.)
Bag containment of CQ&lt;s, on the other hand, was shown to be undecidable by
Jayram et al. [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ].
      </p>
      <p>
        Checking bag-set equivalence of CQ&lt;s was shown to be decidable by Nutt et
al. [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] (Cohen [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] extends it to bag semantics), a result we shall refer to again
in the sequel:
Theorem 1 ([
        <xref ref-type="bibr" rid="ref27 ref8">27, 8</xref>
        ]). Two CQ&lt;s Q, Q′ are bag (bag-set) equivalent if and only
if they have isomorphic linear expansions, which can be checked in pspace.
This theorem also holds for bag-set equivalence for CQ&lt;s. The pspace upper
bound seems unlikely to be tight: in fact, using their characterization of
equivalence in terms of linear expansions, it is not hard to show that the upper bound
can be sharpened somewhat to coNP#P. (coNP#P is contained in pspace, but it
is not known whether the containment is strict.) However, the exact complexity
of the problem remains open.
      </p>
      <p>
        The following simple variation on an example given in [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] shows that
nonisomorphic CQ&lt;s may indeed have isomorphic linear expansions, hence
isomorphism is not a necessary condition for bag equivalence of CQ&lt;s:
Example 1. Let ϕ(x, y, z) be the conjunction of relational atoms R(x, y, z), R(x, z, y),
R(y, x, z), R(y, z, x), R(z, x, y), R(z, y, x). Now consider two Boolean CQs&lt;
Q, Q′ defined
      </p>
      <p>Q() :– ϕ(x, y, z), x &lt; z, y &lt; z, x 6= y
Q′ () :– ϕ(x, y, z), x &lt; y, x &lt; z, y 6= z
The linear expansions of Q and Q′ are</p>
      <p>Q1() :– ϕ(x, y, z), x &lt; z, y &lt; z, x &gt; y
Q2() :– ϕ(x, y, z), x &lt; z, y &lt; z, x &lt; y
Q′1() :– ϕ(x, y, z), x &lt; y, x &lt; z, y &gt; z</p>
      <p>Q′2() :– ϕ(x, y, z), x &lt; y, x &lt; z, y &lt; z
Observe that Q1 is isomorphic to Q′1 and Q2 is isomorphic to Q′2. By Theorem
1, Q and Q′ are bag-equivalent since they have isomorphic linear expansions.
However, Q and Q′ are not isomorphic.
3
3.1</p>
    </sec>
    <sec id="sec-3">
      <title>Symmetry</title>
      <sec id="sec-3-1">
        <title>Motivation and basic definitions</title>
        <p>
          A CQ&lt; is linear [
          <xref ref-type="bibr" rid="ref27 ref9">9, 27</xref>
          ] if its body contains no two occurrences of the same
relational predicate symbol (in other words, self-joins are not allowed). For linear
CQ&lt;, an easy corollary of Theorem 1 (pointed out in [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ]) is that bag equivalence
can be checked in polynomial time.
        </p>
        <p>
          In this section, we introduce a generalization of this restriction based on
what we term the symmetry degree of a query. This is a natural idea derived
from the well-studied notion of the symmetry degree of a graph (see, e.g., [
          <xref ref-type="bibr" rid="ref17 ref18 ref21 ref25">17,
21, 25, 18</xref>
          ]), but it does seem to have been applied in database theory before. An
automorphism of a directed graph G = (V, E) is a permutation σ of the vertex
set V, such that for any edge e = (u, v), σ(e) = (σ(u), σ(v)) is also an edge.
The automorphism group of G contains all these automorphisms. The order of
the automorphism group of G is called its symmetry degree, denoted sym(G). For
queries, the notion is exactly analogous: we define the symmetry degree of a CQ&lt;
Q, sym(Q), to be the order of its automorphism group Aut(QR).
        </p>
        <sec id="sec-3-1-1">
          <title>Example 2. To illustrate, consider the Boolean CQs below:</title>
          <p>Q1() :– P (x1, x2), P (x2, x3), . . . , P (xn−1, xn)
Q2() :– S(u, v), S(u, w)</p>
          <p>Q3() :– R(y1), . . . , R(yn)
Q1 has symmetry degree 1 (the variables must all stay put), Q2 has symmetry
degree 2 (v and w can be swapped), and Q3 has symmetry degree n! (any
permutation of the variables is an automorphism).</p>
          <p>We will examine the complexity of computing sym(Q) in Section 3.2. In the
meantime, we derive an easy bound based on counting self-joins.
Proposition 1. Suppose predicates p1, . . . , pk each occur n1, . . . , nk times,
respectively, in the body of a CQ Q. Define the number of self-joins of Q to be
n = n1 + · · · + nk − k. Then</p>
          <p>k
sym(Q) ≤ Y(ni!) ≤ (n + 1)!.</p>
          <p>i=1
In particular, the proposition implies that linear queries have symmetry degree
one. On the other hand, queries may have low symmetry degree but many
selfjoins, e.g., Q1 in Example 2.</p>
          <p>We introduce some additional terminology to use in the remainder of the
paper. Q is called symmetric if Aut(QR) is a non-trivial subgroup of the symmetric
group on V(Q), i.e. sym(Q) &gt; 1. Q is called asymmetric if Aut(QR) is trivial,
which only contains the identity, i.e. sym(Q) = 1. Q is called rigid if End(QR) is
trivial.</p>
          <p>
            Incidence graphs. A CQ has a natural interpretation as an edge-labeled directed
hypergraph. However, to apply results of interest from graph theory, we may
need to transform this hypergraph into an ordinary directed graph. Given a
CQ Q, we construct its incidence graph [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ] G(Q) = (V, E, λ), a labeled directed
graph, as follows: V has a vertex labeled x for each variable x in Q, a vertex
labeled c for each constant c in Q, and a vertex labeled P for each occurrence of
predicate P in Q; and E contains an edge labeled n from vertex t to predicate
vertex P whenever t occurs as the nth argument in P . For example, the incidence
graph of CQ Q(x) :– T (x, y), S(x, z), S(z, 2) is shown below:
x v
y v
z v
2 2
2 1
We introduce labels in the definition of incidence graph to ensure that the
construction preserves the symmetry degree1 of Q:
Proposition 2. For any CQ Q, we have sym(Q) = sym(G(Q)).
3.2
          </p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>Complexity of Computing Symmetry Degrees</title>
        <p>We next turn to the question of computing the symmetry degree of a CQ, starting
with the simpler problem of deciding whether a query is symmetric. Not
surprisingly, the latter problem reduces easily to the graph automorphism problem
(GA), which is the problem of checking whether a given graph has a non-trivial
automorphism.2
1 The automorphism group of a labeled directed graph G = (V, E, λ) is the subgroup
of the automorphism group of G′ = (V, E) which respects the labeling λ.
2 As with GI, GA is in NP but not known or believed to be either NP-complete or
in ptime. It is no harder than GI in the sense that the problem is polynomial-time
many-one reducible to GI; however the converse relationship is at present unknown.
Proposition 3. Checking whether a CQ&lt; (CQ) is symmetric is
polynomialtime many-one equivalent to the graph automorphism problem.</p>
        <p>
          This leads, using results in [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ], to a characterization of the complexity of
computing the symmetry degree:
Corollary 1. Computing the symmetry degree of a CQ&lt; (or CQ) is
polynomialtime Turing equivalent to the graph isomorphism problem.
        </p>
        <sec id="sec-3-2-1">
          <title>The following is a direct corollary of a result in [3].</title>
          <p>
            Corollary 2 (of Theorem 15 in [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ]). If the number of self-joins in a CQ&lt;
Q is bounded by some constant k, then there is an nO(k) time algorithm that
computes Aut(QR) as a generating set in the symmetric group on V(Q).
          </p>
          <p>
            Finally, we consider testing for rigidity. Again our strategy is to reduce the
problem on CQ&lt; queries to the analogous problem on graphs, where a result of
Goralcik et al. [
            <xref ref-type="bibr" rid="ref11">11</xref>
            ] shows as a special case that graph rigidity is coNP-complete.
Proposition 4. The problem of checking whether a CQ&lt; (CQ) is rigid is
coNPcomplete.
3.3
          </p>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>Symmetry Degree versus Hypertree Width</title>
        <p>
          Gottlob et al. [
          <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
          ] introduced the notion of hypertree width as a generalization
of the classical notion of acyclic queries, and proved that Boolean conjunctive
queries of bounded hypertree width can be evaluated efficiently (and that, as a
consequence, query containment under set semantics is also tractable).
        </p>
        <p>Symmetry degree and hypertree width seem to be essentially orthogonal
concepts: intuitively, hypertree width is in some sense a measure of cyclicity, rather
than symmetry. Moreover, a query with high symmetry degree may have small
hypertree width, such as the following CQ that computes a “star self-join” on
the first column of a relation R:</p>
        <p>Q1() :– R(x, y1), R(x, y2), . . . , R(x, yk)
Q1 has symmetry degree k! but is acyclic hence has hypertree width 1. At the
same time, a query with a high hypertree width may have a small symmetry
degree, such as the CQ below:</p>
        <p>k k
Q2() :– ^ ^
i=1 j=1,j6=i</p>
        <p>Rik−k+j (xi, xj)
(Q2 intuitively corresponds to a complete directed graph without self-loops on
k vertices where each edge is labeled with a distinct predicate name.) Q2 has
symmetry degree 1, but we can show that it has hypertree width ⌈ k/2⌉ .</p>
        <p>We are not aware of any work studying the interaction of hypertree width and
bag equivalence of queries. We also do not know of any work studying whether
bounded hypertree width leads to tractable query containment or equivalence
checks for CQ&lt;s under the classical set semantics.</p>
        <p>
          A recent paper by Pichler et al. [
          <xref ref-type="bibr" rid="ref28">28</xref>
          ] showed that the the query complexity of
evaluating CQs under bag-set semantics becomes tractable when the CQs have
bounded treewidth. A natural question (which we leave open here) is whether
bounded symmetry degree also makes query evaluation under bag or bag-set
semantics tractable.
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Main Results</title>
      <p>We are now ready to present our results on the complexity of bag equivalence
of CQ&lt;s having bounded symmetry degree (Section 4.1). We also discuss how
these bounds transfer to bag-set semantics (Section 4.2), and present an initial
result that applies these ideas to the query equivalence problem under classical
set semantics (Section 4.3).
4.1</p>
      <sec id="sec-4-1">
        <title>Bag Equivalence</title>
        <p>
          As already mentioned, Nutt et al. [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ] showed that checking bag-equivalence of
CQ&lt;s can be done in pspace, but the exact complexity of the problem remains
unclear. Here, we show that if the symmetry degree of the queries is bounded,
then the upper bound can be lowered to Π2p. In fact, we use a rather liberal
notion of “bounded” here where we fix a univariate polynomial P ahead of time
and say that a CQ&lt; Q of length n has polynomially bounded symmetry degree if
sym(Q) ≤ P (n).
        </p>
        <p>Theorem 2. Checking bag equivalence of CQ&lt;s of polynomially bounded
symp
metry degree is in coNPGI , hence in Π2 .</p>
        <p>The proof of the theorem relies on the following technical lemma:
Lemma 1. Let Q be a CQ&lt; of polynomially bounded symmetry degree, and let
QL be one of its linearizations. Then the number of linearizations in lin(Q) that
are isomorphic to QL can be computed in polynomial time with access to a GI
oracle.</p>
        <p>Proof. The basic idea of the proof is as follows: first, we use the GI oracle to
compute Aut(QR); second, we use Aut(QR) to compute the number of linearizations
in lin(Q) that are isomorphic to QL.</p>
        <p>
          To compute Aut(QR), we first compute the generating set of Aut(QR). This
can be done in polynomial time using the GI oracle, since it is well-known that
the problem of computing the generating set of the automorphism group of a
labeled graph is polynomial-time Turing equivalent to GI [
          <xref ref-type="bibr" rid="ref19 ref24">24, 19</xref>
          ]. Now, since we
have assumed sym(Q) ≤ P (n), and we have the generating set for Aut(QR), it
is clear that we can enumerate all the elements of Aut(QR) in polynomial time.
        </p>
        <p>Next, let S denote the set of all linearizations in lin(Q) that are isomorphic
to QL. Our goal is to compute |S|. We observe that a linearization QL′ ∈ S iff
h(L) = L′ for some h ∈ Aut(QR) and L′ |= C, where C denotes the condition
part of Q. In other words, S = {h(QL) | h ∈ Aut(QR) and h(L) |= C}. Since
we have already computed Aut(QR), we can therefore use it to compute S in
polynomial time, and return |S| as the final answer. ⊔ ⊓</p>
        <sec id="sec-4-1-1">
          <title>Now we are ready to prove Theorem 2.</title>
          <p>Proof. By Lemma 1, given a GI oracle and a linearization QL of Q, we can
compute in polynomial time the numbers of linearizations of Q and Q′ , respectively,
which are isomorphic to QL. If these two numbers are different, then it follows
by Theorem 1 that Q and Q′ are not bag-equivalent. Thus we can guess a
nonmembership witness and verify it in polynomial time given a GI oracle, which
means this problem is in coNPGI. Since GI≤pT NP, it follows that the problem
is also in Π2p. ⊔ ⊓</p>
          <p>We note that the pre-condition of Theorem 2 can certainly be checked in
Π2p, by Corollary 1. Also, we note that it is not hard to show that Lemma 1
and Theorem 2 can be generalized to show a Π2p upper bound for checking bag
equivalence of unions of CQ&lt;s (UCQ&lt;s). In Section 4.2, we will also generalize
it to apply to bag-set equivalence.</p>
          <p>Next we show some other (relatively) tractable subcases of checking bag
equivalence of CQ&lt;s. Here, we show that if the number of self-joins is bounded
by some constant, we can push the upper bound down to coNP.
Theorem 3. If the numbers of self-joins in CQ&lt; Q, Q′ are bounded by some
constant k, then the problem of checking whether Q and Q′ are bag equivalent is
in coNP.</p>
          <p>Proof. Here wlog we assume that Q and Q′ have the same relational part, since
their relational parts are isomorphic by Theorem 1. As stated in Proposition 1,
the symmetry degree is bounded by (k + 1)! and we can enumerate the
automorphism group in constant time. For checking bag equivalence of Q and Q′ ,
we can guess a linearization QL. Initialize two sets SQ and SQ′ to be empty. By
applying the automorphism to QL one by one and see if the comparison part is
compatible with the comparison parts of Q and Q′ respectively and if yes add
it to the corresponding SQ or SQ′ . This can be done in polynomial time. If the
orders of these two sets are different, then Q and Q′ are not bag-equivalent,
since they have different numbers of linearizations that are isomorphic to QL.
In other words, we can guess a non-member witness and verify it in polynomial
time. Hence, this problem is in coNP. ⊔ ⊓</p>
          <p>By imposing various restrictions on the symmetry degree of queries, we can
establish other upper bounds on the complexity of the problem. The following
result is one example.</p>
          <p>
            Theorem 4. Asymmetric CQ&lt;s Q and Q′ are bag equivalent iff there is an
isomorphism h from Q′ R to QR such that h(C′ ) |==| C. Moreover, bag equivalence
of asymmetric CQ&lt; queries is polynomial-time Turing equivalent to the graph
automorphism problem.
Proof. By Theorem 1, Q, Q′ have isomorphic linear expansions. In other words,
there is a bijective mapping ψ : lin(Q) 7→ lin(Q′ ) such that QL is isomorphic to
ψ(QL) for all QL ∈ lin(Q). Denote by ϕi the isomorphism mapping from QLi
to ψ(QLi). Since Q, Q′ are asymmetric, there is only one isomorphism mapping
from QR to Q′ R (Suppose there are two ϕ1, ϕ2, then ϕ1 ◦ ϕ−1 is a nontrivial
2
automorphism of QR, which is a contradiction). So, ϕi are all the same for any
QLi ∈ lin(Q). The isomorphism of Q and Q′ follows. The only problem is to
find out this only isomorphism mapping of their relational parts and check if
their comparisons are equivalent under this isomorphism. By [
            <xref ref-type="bibr" rid="ref24">24</xref>
            ], asymmetric
graph isomorphism is polynomial-time Turing equivalent to the graph
automorphism problem. Hence, finding this isomorphism mapping from QR to Q′ R is
polynomial-time Turing equivalent to the graph automorphism problem, so is
the bag equivalence problem. ⊔ ⊓
4.2
          </p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>Bag-Set Equivalence</title>
        <p>Next we examine bag-set equivalence of CQ&lt;s. Theorem 4 holds not just for bag
semantics, but also for bag-set semantics. Let us now look at extending Theorem
2 as well.</p>
        <p>We have the following lemma which is analogous to Lemma 1, but uses an
NP (rather than GI) oracle. Intuitively, we use this extra power to deal with the
fact that for bag-set semantics, when manipulating linearizations, we are forced
to reduce equalities (since this can have the effect revealing that an atom in the
body is actually a duplicate copy and should be removed).</p>
        <p>Lemma 2. Let Q be a CQ&lt; of polynomially bounded symmetry degree, and
let QL be one of its linearizations (with equalities reduced). The number of the
linearizations in lin(Q) that are isomorphic to QL can be computed in polynomial
time with access to a NP oracle.</p>
        <p>Using this lemma, we can establish the analog of Theorem 2 for bag-set
semantics.</p>
        <p>Theorem 5. Checking bag-set equivalence of CQ&lt;s of polynomially bounded
symmetry degree is in coNPNP = Π2p.
4.3</p>
      </sec>
      <sec id="sec-4-3">
        <title>Set Equivalence</title>
        <p>
          We have already seen in the preceding sections that bounded symmetry degree
makes bag (bag-set) equivalence problem of CQ&lt; easier to tackle. We show in this
section a preliminary application of bounded symmetry to checking equivalence
under the classical set semantics. As mentioned earlier, Klug [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] and Van der
Meyden [
          <xref ref-type="bibr" rid="ref29">29</xref>
          ] showed that the containment/equivalent problem is Π2p-complete for
CQ&lt;s, hence equivalence is in Π2p. Here we show that the complexity is lower
than Π2p if the CQ&lt;s are rigid.
        </p>
        <p>Theorem 6. Checking set equivalence of rigid CQ&lt;s is polynomial-time Turing
reducible to the graph automorphism problem.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusions and Future Work</title>
      <p>
        We note that the equivalence results on bag semantics of CQ&lt;s presented here
have wider applicability to any semantics in which CQ&lt; equivalence is
characterized by isomorphism of linearizations. This includes, for example, equivalence of
CQ&lt; on databases annotated with certain kinds of provenance information [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ],
as well as equivalence under the recently proposed Z-semantics [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
      </p>
      <p>We conjecture that if only &lt;, ≤ are allowed as inequalities, two CQ&lt;s Q, Q′
are bag equivalent if and only if there is an isomorphism from Q′ R to QR under
which the condition of Q′ is equivalent to that of Q.</p>
      <p>
        One possible future direction involves applying bounded symmetry degree to
study query containment. Although the decidability of bag containment of CQs
remains a longstanding open problem (Chaudhuri and Vardi [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] showed Π2P
hardness of this problem), bag containment of CQ&lt;s or of conjunctive queries
is known to be undecidable [
        <xref ref-type="bibr" rid="ref20 ref22">20, 22</xref>
        ]. A natural question is whether these
undecidability results hold even for queries of bounded symmetry degree. In fact, the
reduction from Hilbert’s Tenth Problem in [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] constructs a pair of UCQs each
of which is composed of asymmetric CQs, hence bag containment remains
undecidable even for unions of asymmetric CQs. The reduction of [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ], on the other
hand, uses CQ&lt;s of arbitrary symmetry degree, hence it remains open whether
containment of CQ&lt;s of bounded symmetry degree is decidable.
      </p>
      <p>Finally, we would like to pin down the exact complexity of the general case of
bag equivalence of CQ&lt; queries, which seems stubborn to resolve. The problem
is reminiscent to another open issue in the area, that of identifying the exact
complexity of checking bag equivalence of positive relational algebra queries
with inequalities. This class of queries is expressively equivalence to UCQ&lt;, but
exponentially more concise, and here again the known lower and upper bounds
on the complexity are GI and pspace, respectively.</p>
      <p>Acknowledgements. We thank the anonymous reviewers for their helpful
comments. This work was supported by NSF CAREER award IIS-1055107.</p>
    </sec>
    <sec id="sec-6">
      <title>Transitive closure of inequality set</title>
      <p>Consider a satisfiable set C of inequalities, and denote by V (C) the set of
variables and constants occurring in C. The transitive closure of C, denoted by C∗,
is the conjunction of all inequalities over V (C) entailed by C. For example, if
C = {x &lt; y, y ≤ 2}, its transitive closure C∗ = {x &lt; y, y ≤ 2, x &lt; 2, x ≤ y, x ≤
2, x 6= y, y 6= 2, x 6= 2}. (Notice that C |= x &lt; 3, but x &lt; 3 is not contained in
C∗ since 3 does not occur in C.) The transitive closure of a set of inequalities
can be computed in polynomial time.</p>
      <p>Proposition 5. For sets C1 and C2 of inequalities, the following are equivalent:
1. C1 |==| C2, i.e. C1 |= C2 and C2 |= C1.
2. C1 and C2 have the same sets of linearizations.
3. C1 and C2 have the same transitive closures.</p>
      <p>B</p>
    </sec>
    <sec id="sec-7">
      <title>Proofs</title>
      <p>
        Proof. (of Proposition 3) One direction is clear as the graph automorphism
problem can be trivially reduced to the problem of checking symmetry of a Boolean
CQ Q with a single binary relation E such that E(x, y) and E(y, x) are both
subgoals in Q if vertices x and y are adjacent in graph G. In the other direction,
given a CQ Q, we construct its incidence graph G(Q). By Proposition 2, Q is
symmetric iff G(Q) is symmetric. G(Q) is a labeled graph, but it is easy to
verify that labeled graph automorphism is many-one reducible to (ordinary) graph
automorphism, which completes the proof. ⊔ ⊓
Proof. (of Corollary 1) The reductions used in Proposition 3 are parsimonious, so
computing the symmetry degree of a CQ&lt; is polynomial-time many-one
equivalent to #GA3. By results in [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ], #GA is polynomial-time Turing equivalent to
the graph isomorphism problem. ⊔ ⊓
Proof. (of Corollary 2) Since the number of self-joins is bounded, the times
of labels that are used in its associated hypergraph are also bounded, which
corresponds exactly to bounded color classes. Theorem 15 in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] states that
“Given a hypergraph X = (V, E) with color classes of size bounded by k, there
is an nO(k) time algorithm that computes Aut(X ) as a generating set in Sym(V ).
In particular, HGI and HGA are in ptime.”, which completes the proof. ⊔ ⊓
Proof. (of Proposition 4) For CQ&lt; (and hence CQ as well) it is easy to see this
problem is in coNP because we can guess a nontrivial endomorphism candidate
and check in polynomial time if it is an endomorphism. If so, the query is not
3 #GA is the problem of computing the order of graph automorphism group of a given
graph. It is polynomial-time Turing equivalent to #GI and GI [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ], where #GI is
short for the counting the number of graph isomorphisms from one graph to the
other.
rigid. Goralcik et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] showed that the problem of whether a finite algebra
A is nonrigid is NP-complete as soon as the type of A has either one binary or
two unary symbols. This result can be applied in particular to the graph algebra
associated with a directed graph [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] to show that checking rigidity of directed
graphs is also coNP-complete. Since a directed graph can be transformed to a
Boolean CQ using a single binary predicate, such that the graph is rigid iff the
associated query is rigid, it follows that checking rigidity of CQs (and hence also
CQ&lt;s) is coNP-complete.
      </p>
      <p>
        Proof. (of Lemma 2) We can find a homomorphism h from QR to QLR by using
this NP oracle. We can also enumerate all the automorphisms of Q by this NP
oracle in polynomial time since it has polynomial symmetry degree. Using similar
argument as in Lemma 1, by composing h by the elements in Aut(QR) one by
one and applying to L and then see if it is compatible with C, we can get the
number of the linearizations in lin(Q) that are isomorphic to QL. ⊔ ⊓
Proof. (of Theorem 5) Use the same argument as in Theorem 2, but instead of a
p
GI oracle, we use an NP oracle as Lemma 2 suggests. This yields a coNPNP = Π2
upper bound. ⊔ ⊓
Proof. (of Theorem 6) Assuming that two rigid queries Q and Q′ are set
equivalent, then there is only one homomorphism mapping ψ from Q′ R to QR and
only one homomorphism mapping ϕ from QR to Q′ R, i.e. QR and Q′ R are
homomorphically equivalent. But Q and Q′ are rigid, hence cores, and if two cores
are homomorphically equivalent then they are isomorphic. Since Q′ R and QR
are cores, ψ is a unique isomorphism from Q′ R to QR. Now the only problem
is to find out this unique isomorphism mapping, and check the conditions of
these queries are compatible under this mapping which is in polynomial time.
By [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ], asymmetric graph isomorphism is polynomial-time Turing equivalent to
the graph automorphism problem. Since rigid graphs are subclass of asymmetric
graphs, the set equivalence problem is polynomial-time Turing reducible to the
graph automorphism problem. ⊔ ⊓
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>S.</given-names>
            <surname>Abiteboul</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Hull</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V.</given-names>
            <surname>Vianu</surname>
          </string-name>
          .
          <source>Foundations of Databases. Addison-Wesley</source>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>F. N.</given-names>
            <surname>Afrati</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Damigos</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Gergatsoulis</surname>
          </string-name>
          .
          <article-title>Query containment under bag and bag-set semantics</article-title>
          .
          <source>Inf</source>
          . Process. Lett.,
          <volume>110</volume>
          :
          <fpage>360</fpage>
          -
          <lpage>369</lpage>
          ,
          <year>April 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>V.</given-names>
            <surname>Arvind</surname>
          </string-name>
          and
          <string-name>
            <surname>J. K</surname>
          </string-name>
          <article-title>¨obler</article-title>
          .
          <article-title>On Hypergraph and Graph Isomorphism with Bounded Color Classes</article-title>
          .
          <source>STACS</source>
          <year>2006</year>
          , pages
          <fpage>384</fpage>
          -
          <lpage>395</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>N.</given-names>
            <surname>Brisaboa</surname>
          </string-name>
          , H. Hern´andez, J. Param´a, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Penabad</surname>
          </string-name>
          .
          <article-title>Containment of conjunctive queries with built-in predicates with variables and constants over any ordered domain</article-title>
          .
          <source>In Advances in Databases and Information Systems</source>
          . Springer,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>A. K.</given-names>
            <surname>Chandra</surname>
          </string-name>
          and
          <string-name>
            <given-names>P. M.</given-names>
            <surname>Merlin</surname>
          </string-name>
          .
          <article-title>Optimal implementation of conjunctive queries in relational data bases</article-title>
          .
          <source>In STOC</source>
          ,
          <year>1977</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>S.</given-names>
            <surname>Chaudhuri</surname>
          </string-name>
          and
          <string-name>
            <given-names>M. Y.</given-names>
            <surname>Vardi</surname>
          </string-name>
          .
          <article-title>Optimization of real conjunctive queries</article-title>
          .
          <source>In PODS '93</source>
          , pages
          <fpage>59</fpage>
          -
          <lpage>70</lpage>
          , New York, NY, USA,
          <year>1993</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>C.</given-names>
            <surname>Chekuri</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Rajaraman</surname>
          </string-name>
          .
          <article-title>Conjunctive query containment revisited</article-title>
          .
          <source>Theor. Comput. Sci.</source>
          ,
          <volume>239</volume>
          :
          <fpage>211</fpage>
          -
          <lpage>229</lpage>
          , May
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>S.</given-names>
            <surname>Cohen</surname>
          </string-name>
          .
          <article-title>Equivalence of queries that are sensitive to multiplicities</article-title>
          .
          <source>The VLDB Journal</source>
          ,
          <volume>18</volume>
          (
          <issue>3</issue>
          ):
          <fpage>765</fpage>
          -
          <lpage>785</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>M. P.</given-names>
            <surname>Consens</surname>
          </string-name>
          and
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          .
          <article-title>Graphlog: a visual formalism for real life recursion</article-title>
          .
          <source>In PODS '90</source>
          , pages
          <fpage>404</fpage>
          -
          <lpage>416</lpage>
          , New York, NY, USA,
          <year>1990</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>V.</given-names>
            <surname>Dalmau</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Jonsson</surname>
          </string-name>
          .
          <article-title>The complexity of counting homomorphisms seen from the other side</article-title>
          .
          <source>TCS</source>
          ,
          <volume>329</volume>
          (
          <issue>1-3</issue>
          ):
          <fpage>315</fpage>
          -
          <lpage>323</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>P.</given-names>
            <surname>Goralcik</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Koubek</surname>
          </string-name>
          .
          <article-title>Verifying nonrigidity</article-title>
          .
          <source>Information Processing Letters</source>
          ,
          <volume>22</volume>
          (
          <issue>2</issue>
          ):
          <fpage>91</fpage>
          -
          <lpage>95</lpage>
          ,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12. G. Gottlob,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Scarcello</surname>
          </string-name>
          .
          <article-title>Hypertree decompositions and tractable queries</article-title>
          .
          <source>In PODS '99</source>
          , pages
          <fpage>21</fpage>
          -
          <lpage>32</lpage>
          , New York, NY, USA,
          <year>1999</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. G. Gottlob,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Scarcello</surname>
          </string-name>
          . Hypertree Decompositions:
          <string-name>
            <given-names>A</given-names>
            <surname>Survey. In</surname>
          </string-name>
          <string-name>
            <surname>FOCS</surname>
          </string-name>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. G. Gottlob,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Scarcello</surname>
          </string-name>
          . Robbers, marshals, and
          <article-title>guards: game theoretic and logical characterizations of hypertree width</article-title>
          .
          <source>JCSS</source>
          ,
          <volume>66</volume>
          (
          <issue>4</issue>
          ):
          <fpage>775</fpage>
          -
          <lpage>808</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. T. J.
          <string-name>
            <surname>Green</surname>
          </string-name>
          .
          <article-title>Containment of conjunctive queries on annotated relations</article-title>
          .
          <source>In ICDT</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. T. J.
          <string-name>
            <surname>Green</surname>
            ,
            <given-names>Z. G.</given-names>
          </string-name>
          <string-name>
            <surname>Ives</surname>
            , and
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Tannen</surname>
          </string-name>
          .
          <article-title>Reconcilable differences</article-title>
          .
          <source>In ICDT</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <given-names>Z.</given-names>
            <surname>Hedrl</surname>
          </string-name>
          <article-title>´ın and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Pultr</surname>
          </string-name>
          .
          <article-title>Symmetric relations (undirected graphs) with given semigroups</article-title>
          .
          <source>Monatsh</source>
          . Math.,
          <volume>69</volume>
          (
          <issue>4</issue>
          ):
          <fpage>318</fpage>
          -
          <lpage>322</lpage>
          ,
          <year>1965</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>P.</given-names>
            <surname>Hell</surname>
          </string-name>
          and
          <string-name>
            <surname>J. Nesˇsetˇril.</surname>
          </string-name>
          <article-title>Graphs and homomorphisms</article-title>
          . Oxford University Press, USA,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>C.</given-names>
            <surname>Hoffmann</surname>
          </string-name>
          .
          <article-title>Group-theoretic algorithms and graph isomorphism</article-title>
          .
          <source>Lecture notes in computer science</source>
          . Springer,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <given-names>Y. E.</given-names>
            <surname>Ioannidis</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Ramakrishnan</surname>
          </string-name>
          .
          <article-title>Containment of conjunctive queries: beyond relations as sets</article-title>
          .
          <source>ACM Trans. Database Syst</source>
          .,
          <volume>20</volume>
          (
          <issue>3</issue>
          ):
          <fpage>288</fpage>
          -
          <lpage>324</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21. S. Janson,
          <string-name>
            <given-names>T.</given-names>
            <surname>Luczak</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Rucin</surname>
          </string-name>
          <article-title>´ski. Random graphs</article-title>
          .
          <source>Wiley-Interscience Series in Discrete Mathematics and Optimization</source>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22. T. S. Jayram,
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Kolaitis</surname>
          </string-name>
          , and
          <string-name>
            <surname>E. Vee.</surname>
          </string-name>
          <article-title>The containment problem for real conjunctive queries with inequalities</article-title>
          .
          <source>In PODS</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <given-names>A.</given-names>
            <surname>Klug</surname>
          </string-name>
          .
          <article-title>On conjunctive queries containing inequalities</article-title>
          .
          <source>J. ACM</source>
          ,
          <volume>35</volume>
          (
          <issue>1</issue>
          ):
          <fpage>146</fpage>
          -
          <lpage>160</lpage>
          ,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>J. K</surname>
          </string-name>
          <article-title>¨obler</article-title>
          , U. Sch¨oning, and J.
          <string-name>
            <surname>Tor</surname>
          </string-name>
          <article-title>´an. The graph isomorphism problem: its structural complexity</article-title>
          . Springer,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <given-names>J.</given-names>
            <surname>Lauri</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Scapellato</surname>
          </string-name>
          .
          <article-title>Topics in graph automorphisms and reconstruction</article-title>
          . Cambridge Univ Pr,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <given-names>G.</given-names>
            <surname>McNulty</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Shallon</surname>
          </string-name>
          .
          <article-title>Inherently nonfinitely based finite algebras</article-title>
          . In R. Freese and O. Garcia, editors,
          <source>Universal Algebra and Lattice Theory</source>
          .
          <year>1983</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27. W. Nutt,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Sagiv</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Shurin</surname>
          </string-name>
          .
          <article-title>Deciding equivalences among aggregate queries</article-title>
          .
          <source>In PODS '98</source>
          , pages
          <fpage>214</fpage>
          -
          <lpage>223</lpage>
          , New York, NY, USA,
          <year>1998</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <given-names>R.</given-names>
            <surname>Pichler</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Skritek</surname>
          </string-name>
          .
          <article-title>The complexity of evaluating tuple generating dependencies</article-title>
          .
          <source>In ICDT2011.</source>
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29. R. van der Meyden.
          <article-title>The complexity of querying indefinite data about linearly ordered domains</article-title>
          .
          <source>In PODS '92</source>
          , pages
          <fpage>331</fpage>
          -
          <lpage>345</lpage>
          , New York, NY, USA,
          <year>1992</year>
          . ACM.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>