<!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>Intuitionistic Data Exchange</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gosta Grahne</string-name>
          <email>grahne@cs.concordia.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ali Moallemi</string-name>
          <email>moa_ali@encs.concordia.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Adrian Onet</string-name>
          <email>adrian_onet@yahoo.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Concordia University</institution>
          ,
          <addr-line>Montreal</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The eld of Data Exchange has overcome many obstacles, but when it comes to negation in rule bodies combined with existentially quanti ed variables in rule heads, to unequalities ≠, as well as to inconsistency management, the same intractability barriers that plague the area of incomplete information arise. In this paper we develop an intuitionistic relevance-logic based semantics that allows us to extend the polynomial time \naive evaluation" technique to Data Exchange dependencies (TGDs and EGDs) with negated atoms and unequalities, and to Data Exchange Target Queries consisting of unions of conjunctive queries with negation and unequalities. The semantics is also paraconsistent, and avoids the intractability barriers encountered in inconsistency management as well.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The problem of data exchange poses one of the major challenges in distributed
information processing environments. A connection in such an environment can
be viewed as a labeled directed edge from a node representing a source database to
a node representing a target database. The edge-label denotes a schema mapping
that guides the middle-ware in restructuring the data from the source database
to t the requirements of the target database. Since its inception in 2003 by
Fagin et al. in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], the eld of data exchange has been intensely investigated, and
many functionalities are mature for technology transfer. In this paper we focus
on the problems of
{ computing and materializing target instances when the schema mapping is
expressed as a set of embedded dependencies (TGDs and EGDs), and
{ computing certain answers to unions of conjunctive queries expressed on the
target schema (target UCQs).
      </p>
      <p>
        These problems have been shown to admit e cient implementation, based
on a property colloquially called the naive evaluation property. The property
roughly says that the incompleteness of some domain values can be ignored, as
long as these values are distinguished from each other, and from the \ordinary"
domain values that denote named and known objects. The price to pay is that we
have to restrict the schema-mappings and target queries to be monotone. Most
attempts to include non-monotone features, such as negation (¬) and unequality
(≠), soon run into intractability barriers, due to the underlying issues of
incomplete information. For a comparison between di erent closed world semantics
the reader should consult [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ].
      </p>
      <p>
        We recall (see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]) that a tuple generating dependency (TGD) is a rst order
formula of the form ∀XY  (XY) → ∃Z (XZ), where and are
conjunctions of relational atoms, and X, Y, and Z are sequences of variables. We refer to
as the body of the dependency, and to as the head. In an equality generating
dependency (EGD), there is no existential quanti cation, and is an equality
X1 = X2, where X1 and X2 are variables from XY.
      </p>
      <p>
        When it comes to dependencies with negation in the body, the main
proposals are the strati ed model the stable model and the well-founded model (for
de nitions, see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]). We argue that these semantics are not well suited for data
exchange, mainly because they \favor" negative information. Sometimes this is
desirable, as for example in the classical Tweety-example:
      </p>
      <p>∀X BIRD(X); ¬P EN GU IN (X) → F LY (X):
If the source database is {BIRD(tweety)} it might be desirable to \defeasibly"
conclude F LY (tweety). However, if we use the same semantics for
∀X COUN T RY (X); ¬N U KES(X) → F RIEN D(X);
and the source database is {COU N T RY (sylvania)}, it might not be prudent
to conclude F RIEN D(sylvania).</p>
      <p>
        Intuitionistic logic rejects the law of the excluded middle and non-constructive
existence proofs. The motivation is usually epistemological, but it can also be
computational, as in Kleene's intuitionistic logic based on recursive predicates
[
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. In an intuitionistic approach we would assign both F LY (tweety) and
F RIEN D(sylvania) the value unknown or undetermined. This does not
preclude the truth-value to later change, as was for example the case with (the
knowledge of) the truth-value of the statement expressing Fermat's Last
Theorem, that changed from unknown to true in 1994.
      </p>
      <p>
        If non-constructive existence proofs are epistemologically susceptible, what
can one say about defeasible reasoning? We contend that negative facts should
be explicitly derived, just as the positive ones are. In other words, only if we
have explicitly decided the fact ¬P EN GU IN (tweety) can we draw the
conclusion F LY (tweety). In this spirit we propose to use Nuel Belnap's four-valued
relevance logic R [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] as foundation for negation in data exchange. This allows
us to derive e cient algorithms for:
{ computing and materializing target instances when the schema mapping is
expressed as a set of TGDs with negated atoms in the body and in the head,
and EGDs with negation in the body, and
{ computing certain answers to target unions of conjunctive queries with
negation and unequality (≠).
      </p>
      <p>
        Belnap's logic also is paraconsistent, meaning that \if we have inconsistent
information about ducks, it is possible that our information about decimals can
still be trusted" (see Fitting [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], page 10). This feature allows e cient
inconsistency management, which is not in general possible in the repair-approach
of [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        The rest of this paper is organized as follows. The next section introduces the
notions used throughout the paper. This is followed by the section dedicated to
Belnap's Logic FOUR that plays a central role in this paper. Section 4 describes
the \naive evaluation" of conjunctive queries with negation, and Section 5 adds
negation to the bodies of tuple generating dependencies, in a way that allows us
to extend the \naive chase" (i.e. the standard chase [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]). In Section 6 we study
how our techniques a ect the termination of the chase procedure. We end with
conclusions in Section 7.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>
        For basic de nitions and concepts we refer to [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Let a = a1; a2; : : : ; an and
b = b1; b2; : : : ; bm be sequences of elements from a semigroup (a set with a
binary associative operation ⋅ ). Then ab denotes the concatenation sequence
a1; a2; : : : ; an; b1; b2; : : : ; bm, and if n = m we can form the product sequence
a ⋅ b = a1 ⋅ b1; a2 ⋅ b2; : : : ; an ⋅ bn. The length of a sequence a = a1; a2; : : : ; an,
denoted SaS, is n. The empty sequence is denoted . Let X = X1; X2; : : : ; Xn be a
sequence and A a set. Then a mapping f ∶ X → An, where f (Xi) = ai, is listed
as f = {X1~a1; X2~a2; : : : ; Xn~an}.
      </p>
      <p>Signatures, schemas, languages etc. A signature consists of a nite set
R = {R; S; : : :} of relation symbols (called the schema), a countably in nite set
Vars = {X; Y; Z; : : :} of variables, a countably in nite set Nulls = {x; y; z; : : :} of
nulls, and a countably in nite set Cons = {a; b; c; : : :} of constants. We assume
that Nulls and Cons are semigroups under the ⋅ operation. Each relational symbol
R ∈ R has an associated natural number ar(R), called the arity of R.</p>
      <p>Let be a signature. The set of well-formed formulas (w 's) of the language
L is de ned inductively by stating that each atom R(X), where R ∈ R and
X ∈ (Vars ∪ Cons)ar(R), is a w , and then closing the set under ∨ ∧ ¬ ∃
; ; ; , and
∀. If (X) is a L -formula, then v ars( ) denotes its variables, the sequence X
denotes the free variables, and cons( ) the constants in . If (X) is a formula
and v is the mapping X ↦ a, then (a) denotes the sentence (v(X)). If a w
does not have any free variables, it is called a sentence.</p>
      <p>
        Boolean valued instances. In algebraic semantics (see e.g. [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ]) an
interpretation of sentences in the object language is obtained through a homomorphism h
into a structure (A; '), where A is an algebra, and ' is a subset of the carrier set
A of A. The elements in ' represent \truth." The homomorphism maps atomic
sentences to elements in A, and the connectives and quanti ers are mapped into
operators in the algebra. Under interpretation h, a sentence is then \true"
in A, if h( ) ∈ '.
      </p>
      <p>
        The well known Boolean valued models [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] are obtained by taking the algebra
to be a Boolean algebra B = (B; ∨; ∧; ¬; 0; 1); and ' to be an ultra lter of B.
Recall that an ultra lter is a subset ' of B, such that 1 ∈ '; for all b1; b2 ∈ B,
b1 ∧ b2 ∈ ' i b1 ∈ ' and b2 ∈ '; and for all b ∈ B either b ∈ ' or ¬ b ∈ ', but
{b; ¬ b} ⊆~ '. Adapting this approach to database instances (models), we get the
following de nitions.
      </p>
      <p>De nition 1. Let = (R; Vars; Nulls; Cons) be a database signature, and let
B = (B; ∨; ∧; ¬; 0; 1) be a Boolean algebra. A B-instance I consists of the
following parts:
1. A nite set of elements d om(I) ⊆ Cons ∪ Nulls, the domain of I,
2. cons(I) = d om(I) ∩ Cons, the constants of I,
3. The set nulls(I) = d om(I) ∩ Nulls, the nulls of I, and
4. For each R ∈ R and a ∈ d om(I)ar(R), an interpretation R(a)I ∈ B.
De nition 2. Let be an L-sentence, B a Boolean algebra, ' ⊂ B an ultra lter
in B, and I a B-interpretation. Then the satisfaction relation I ⊧B;' is de ned
inductively as follows.
1. I ⊧B;' R(a), if R(a)I ∈ ',
2. I ⊧B;' ∧ , if I ∧ I ∈ ',
3. I ⊧B;' ¬ , if ¬( I ) ∈ ',
4. I ⊧B;' ∀X (X), if ⋀ a∈dom(I)ar(R) ( (a)I ) ∈ ',
5. I ⊧B;' → , if I ∈ ' entails that I ∈ '.</p>
      <p>The natural partial order ≤ in B is de ned as ≤ i ∨ = . The partial
order can be lifted to (B; ')-instances I and J by stipulating that I ≤ J if
cons(I) ⊆ cons(J ), and there is a mapping h ∶ d om(I) → d om(J ), identity on
the constants, such that R(a)I ≤ R(h(a))J , for all R ∈ R and a ∈ d om(I)ar(R).
Such a mapping h is said to be a homomorphism from I to J . It is easily shown
that ≤ is a partial order on the equivalence classes generated by the relation
I ≃ J , de ned to hold i I ≤ J and J ≤ I.</p>
      <p>Going back to the satisfaction relation ⊧B;', note that if B = {0; 1}, then
B = 2 (the two-element Boolean algebra), and the unique ultra lter is { }
1 . Thus
we can write simply ⊧2, and I ⊧2 becomes the standard two-valued semantics
in which → behaves as material implication. Thus I ⊧2 → if and only if</p>
      <p>
        I ≤ I . Here ≤ is the natural order, i.e. 0 ≤ 1, and I ≤ J means that there is a
classical database homomorphism [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] from I to J , and I ≃ J means that I and
J are homomorphically equivalent (in the classical database sense).
Conjunctive queries and certain answers. A conjunctive query (CQ) is a
rst order formula of the form q = ∃Y (XY); where is a conjunction of
atoms of L . For an atom R of arity k in , for notational convenience we write
R(XY) instead of R(xi1 ; : : : ; xik ), where xi1 ; : : : ; xik is a subsequence of XY.
The free variables of are those in X. If X = , the expression denotes a Boolean
CQ. A query q is called a union of conjunctive queries (UCQ) if it is of the form
q = ∃Y( 1(XY)∨ : : : ∨ m(XY)); where each i is a conjunction of atoms. It is
a well known fact that UCQs are monotonic in the 0 ≤ 1 partial order, meaning
that if I ≤ J , then q(I) ≤ q(J ), for all UCQs q. It has further been shown in [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]
that I ≃ J if and only if q(I) ≃ q(J ), for all UCQs q. Thus, if a user only has
UCQs as query language, then the user cannot distinguish between ≃-equivalent
(homomorphically equivalent) instances. This leads to the important notion of
incomplete instances and certain answers, instrumental in data exchange [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
Conceptually, an incomplete database instance is a set X of ordinary instances I.
The information that is certain is the information that holds in all possible
instances (possible worlds). This leads to the de nition of the certain answer to
a UCQ q on an incomplete instance X as ⋀q(X ) = ⋀{q(I) ∶ I ∈ X }: Here ⋀
denotes the ≤-greatest lower-bound (modulo ≃) of a set of ordinary instances.
Likewise, ⋁ denotes the ≤-least upper-bound (modulo ≃). The least upper-bound
is clearly given by the disjoint (rename nulls apart) union. The lower bound ⋀
has been shown to exist by Hell and Nesetril [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], whose results were generalized
by Libkin in [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. In particular, Libkin showed that if X is a nite set of instances,
then ⋀(X ) can always be represented as a nite instance (up to ≃-equivalence).
      </p>
      <p>
        Usually the certain answer is further restricted to only the named domain
values (the constants). For an instance I, de ne I↾ as function I restricted to
sequences of objects in cons(I). Thus, the usual certain answer is
C ert(q; X ) = ( {q(I) ∶ I ∈ X })↾ :
(1)
Note that q(X ) is what Libkin [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] calls answers as knowledge, while (1) is
his answers as objects. Since an instance I can contain nulls, it can be viewed
as a \naive table" [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], that represents the set of complete (ground) instances
XI = {J ∶ I ≤ J and d om(J ) ⊆ Cons}. Consider now an instance I as a naive
table representing the set XI of possible worlds. Then the \naive evaluation
theorem" says that ⋀q(XI ) ≃ q(I): Consequently for a UCQ q, we have [
        <xref ref-type="bibr" rid="ref18 ref8">18, 8</xref>
        ]:
C ert(q; XI ) = q(I)↾ :
(2)
3
      </p>
      <p>
        Belnap's logic F OU R
We are interested in Belnap's intuitionistic logic FOUR. This logic has a sound
and complete axiomatization in terms of a system R of relevance logic, and
→ becomes relevant entailment of rst degree (see [
        <xref ref-type="bibr" rid="ref2 ref5">2, 5</xref>
        ]).
      </p>
      <p>
        The logic FOUR is a generalization of Kleene's strong three-valued logic.
FOUR has four truth-values ∅; {f }; {t}, and {f ; t}. Intuitively, assigning a
sentence the value {t} means that \the computer has been told that is true,"
(see [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], page 11) and assigning the value {f } means that \the computer has been
told that is false." Furthermore, the value {f ; t} means that \the computer
has been told that is false, and the computer has been told that is true." In
other words, is inconsistent. Finally, assigning the value ∅ means that \the
computer has not been told anything about the truth-value of ," that is, the
truth-value of is unknown.
      </p>
      <p>Since truth-values are sets, they are naturally ordered by set-inclusion. The
more elements the set contains, the more information the computer has about
the truth. This gives rise to the information ordering, which we in the sequel
will denote t. We can still retain the ≤-order, which is called the truth order, by
stipulating that {f } ≤{t}, and that ∅ and {f ; t} are incomparable and both lie
strictly between {f } and {t}. We shall use the following symbols: 0 for {f }, 1
for {t},  for ∅, and ⊺ for {f ; t}. Furthermore, ⊺ and  are incomparable wrt
≤, and 0 and 1 are incomparable in t. All of this can be put together into a
structure 4 = (4; ∨; ∧; /; .; ¬; 0; 1; ; ⊺); where 4 = {; ⊺; 0; 1}. Here ∨ is the least
upper bound in the ≤-order, and ∧ the greatest lower bound (i.e. ⊺ ∨  = 1, and
⊺ ∧  = 0, etc). The least upper bound in the t-order is /, and the greatest lower
bound is . (e.g. 0 / 1 = ⊺, and 0 . 1 = , etc). For negation, ¬ 1 = 0; ¬ 0 = 1; ¬ ⊺ = ⊺,
and ¬  = . Consequently, (4; ∨; ∧; ¬; 0; 1) is a Boolean algebra.</p>
      <p>
        Belnap's structure 4 has subsequently been generalized by Ginsberg and
Fitting to so called bilattices [
        <xref ref-type="bibr" rid="ref12 ref9">12, 9</xref>
        ]. The simplest non-trivial bilattice is 4, just
as 2 is the simplest non-trivial Boolean algebra. Bilattices have been thoroughly
investigated by Fitting and Avron, among others (see e.g. [9, ?,?,?]). The algebra
4 has been shown to provide a principled and uniform account of various
nonmonotonic semantics of logic programming with negation, including the stable
models and the well-founded model.
      </p>
      <p>
        Since 4 is an algebra, it can be used to give meaning to L sentences, by
choosing the designated values '. Arieli and Avron [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] have argued that ' should
be a ultrabi lter1 and they have shown that ' = {⊺; 1} is the unique ultrabi lter
in 4. We shall thus work with the algebraic semantics (4; {⊺; 1}).
      </p>
      <p>A 4-instance is then a B-interpretation of De nition 1, where B = 4, and
by noticing that (4; ∨; ∧; ¬; 0; 1) is a Boolean algebra, I ⊧4 can be read from
De nition 2 of ⊧(B;'), by choosing B = 4, and ' = {⊺; 1}.</p>
      <p>Let I and J be 4-instances, such that cons(I) ⊆ cons(J ) and let h be a
mapping from d om(I) to d om(J ), such that h is identity on the constants.
The mapping h is said to be a homomorphism from I to J , provided that
R(a)I t R(h(a))J , for all R ∈ R and a ∈ d om(I)ar(R). The partial order t of 4
is lifted to 4-instances in the following de nition.</p>
      <p>De nition 3. Let I and J be 4-instances such that cons(I) ⊆ cons(J ). We
say that J is more informative than I, denoted I t J , if there is a
homomorphism from I to J . Furthermore, if both I t J and J t I, we say that I and
J are information equivalent, and denote it I ≐ J . Let I denote the set of all
instances over . Then I ~≐ denotes the set of equivalence classes of instances
induced by ≐.</p>
      <p>
        Clearly t is a partial order on I ~≐. Due to space limitation, the de nitions
for relations . and / are omitted, they can be found in the full version [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. We
need to verify that . and / indeed are the meet and join in the lattice induced
by t.
1 For a technical de nition, see [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
Lemma 1. Let I and J be 4-instances. Then I t J if and only if I . J ≐ I.
and I t J if and only if I / J ≐ J .
      </p>
      <p>Reducing FOUR to T WO. We now losslessy represent a 4-instance as a
twovalued instance as follows.</p>
      <p>De nition 4. 1. Let I be a 4-instance over schema R. The 2 -projection of I,
denoted I↓2, is a two-valued Boolean instance over schema ⋃R∈R{R+; R−},
where
(a) cons(I↓2) = cons(I), nulls(I↓2) = nulls(I), and d om(I↓2) = d om(I).
(b) For all relations R ∈ R and a = a1; : : : ; a (R), where ai ∈ d om(I) for all
iR∈−{(a1;):I:↓2: ;= 1(Rif)}R, (Ra)+I(au)I0↓,2 a=n1d i0f oRt(haer)wIiuse1., and 0 otherwise; and
2. Let I be a 2-instance. Then the 4-instance corresponding to I is I↑4, where
(a) cons(I↑4) = cons(I), nulls(I↑4) = nulls(I), and d om(I↑4) = d om(I).
(b) For all R ∈ R and a = a1; : : : ; a (R), for all i ∈ {1; : : : ; (R)},
R(a)I↑4
⎧⎪ ⊺ if R+(a)I = 1 and R−(a)I = 1
⎪
⎪
⎪⎪  if R+(a)I = 0 and R−(a)I = 0
= ⎨⎪ 1 if R+(a)I = 1 and R−(a)I = 0
⎪
⎪⎪⎪ 0 if R+(a)I = 0 and R−(a)I = 1
⎩
4</p>
    </sec>
    <sec id="sec-3">
      <title>UCQs with negation</title>
      <p>The intuitionistic semantics (4; {⊺; 1}) allows us to extend the (polynomial time)
\naive evaluation" from unions of conjunctive queries to unions of conjunctive
queries with negation. We next de ne CQs with negation. UCQs with negation
is de ned similarly.</p>
      <p>A literal is an expression of the form R(X) or ¬R(X), where R(X) is an
atom in L . A conjunctive query with negation (NCQ) is a rst order formula of
the form q = ∃Y (XY); where is a conjunction of literals. Consider now an
NCQ
n</p>
      <p>n+m
q = ∃Y </p>
      <p>Ri(XY) ∧</p>
      <p>¬Ri(XY):
i=1 i=n+1
The NCQ q, when applied on an instance I, extends the interpretation I to also
include the relation Q, de ned as follows.
(3)
De nition 5. Let I be a 4-instance and q = ∃Y (XY) an NCQ of the form
(3). Let v range over all mappings from XY to d om(I). Then</p>
      <p>Q(a)I =</p>
      <p>n
{v ∶ v(X)=a} i=1Ri(v(XY))I ∧
n+m
i=n+1¬ Ri(v(XY))I ;
for each a ∈ d om(I)SXS.</p>
      <p>
        We next show that NCQs are monotonic in the information order t. By a
recent result of Gheerbrant et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], such monotonicity is a necessary and
su cient condition for a class of queries to admit naive evaluation. Indeed, the
following holds.
      </p>
      <p>Theorem 1. Let q be an NCQ, and let I and J be 4-instances, such that I t J
by homomorphism h. Then Q(a)I t Q(h(a))J , for all a ∈ d om(I)ar(Q).</p>
      <p>Furthermore, the naive evaluation property of CQs on 2-instances can now be
extended to NCQs on 4-instances. It turns out that an NCQ q can be evaluated
naively on I↓2 by turning q into a UCQs, denoted q↓2. Assume q is of the form
(3). Then
q↓2 = ∃Y
n
i=1
n+m
i=n+1
n
i=1</p>
      <p>m
j=n+1
Ri+(XY) ∧</p>
      <p>Ri−(XY) ∨</p>
      <p>Ri−(XY) ∨</p>
      <p>Rj+(XY): (4)</p>
      <p>In the next theorem we view an NCQ query q as mapping an instance
I to the instance q(I), where q(I) is a 4-instance over schema {Q}, with
Q(a)q(I) = Q(a)I .</p>
      <p>Theorem 2. Let q be an NCQ and I a 4-instance. Then q(I) ≐ (q↓2(I↓2))↑4:
Similarly to the two-valued case, we can regard a 4-instance I as a naive table
de ning the set XI = {J ∶ I t J and d om(J ) ⊆ Cons} of possible worlds.
We can now extended the naive evaluation property to NCQs on 4-instances, by
using the result (proved in the full version) that q(XI) ≐ q(I). In analogue
with (1) we de ne the certain answer as C ert4(q; X ) = ( {q(I) ∶ I ∈ X })↾ : To
wrap this section up formally, we conclude
Corollary 1. Let q be an NCQ and I a 4-instance. Then C ert4(q; XI) =
(q↓2(I↓2)↑4↾ :</p>
      <p>Note that all the previous results hold as well for the larger class NUCQ of
unions of conjunctive queries with negation. We have only presented the
transformation of NCQs q into UCQs q↓2. In a very similar fashion we can transform
any NUCQ query into a UCQ, while preserving all theorems of this section, and
in particular Corollary 1.
5</p>
      <p>
        Data Exchange in T WO and FOUR
A tuple generating dependency (TGD) is a rst order formula having the form
∀XY( (XY) → ∃Z R(XZ)): An equality generating dependency (EGD) is a
rst order formula of the form ∀X( (X) → X1 = X2); where X1 and X2 are
variables in X. A TGD with negation and unequality (NTGD≈~ ) is a TDG that
can have atomic negations in the body and in the head, and that also includes
a special equality symbol ≈, possibly negated (denoted ≈~). Note that NTGD≈s
include the EGDs. Also, the notion of a 4-instance has to be extended to account
for the explicit equality. Details appear in the full paper [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. The salient point
is that an atom a ≈ b can have truth-values in 4, meaning that (a ≈ b)I can be
inconsistent or unknown, in addition to true or false. Let n ∈ {2; 4}. A
dependency is said to be satis ed in an n-instance I if I ⊧n . A set of dependencies
is denoted , and I ⊧n , if I ⊧n for all ∈ . The following is a central
concept in data exchange.
      </p>
      <p>De nition 6. Let I be a 2-instance (a 4-instance) and a set of TGDs and
EGDs (a set of NTGD≈s). A 2-universal model (a 4-universal model) of (I; )
is a 2-instance J (a 4-instance J ), such that
1. I ≤ J (I t J ),
2. J ⊧2 (J ⊧4 ), and
3. for all instances K, if I ≤ K and K ⊧2
(if I t K and K ⊧4
, then J ≤ K
, then J t K).</p>
      <p>
        Let I be a 2-instance and a set of dependencies. The de nition of the
procedure C hase(I; ) can be found in [
        <xref ref-type="bibr" rid="ref7 ref8">8, 7</xref>
        ]. The chase procedure is said to
successfully terminate (or simply terminate) [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], if it does not fail due to some
EGD and it stops after a nite number of steps. In this case C hase(I; )
denotes the instance returned by the chase procedure. It is known (see [
        <xref ref-type="bibr" rid="ref7 ref8">8, 7</xref>
        ]) that
C hase(I; ) is a 2-universal model of (I; ).
      </p>
      <p>Data Exchange. A data exchange schema is a schema of the form S ∪ T, where
S ∩ T = ∅. The schema S is called the source schema, and T is called the target
schema. Let S∪T be a data exchange schema. A source-to-target TGD (st-TGD)
is a TGD where the relation symbols in the body come from S and the relation
symbols in the head come from T. Source-to-target NTGD≈s (s-t NTGD≈s) are
de ned similarly. A target EGD (t-EGD) is an EGD where all relation symbols
come from T. A data exchange setting is a pair (S ∪ T; ), where S ∪ T is a data
exchange schema, and is a set of s-t TGDs (or s-t NTGD≈s) and t-EGDs.</p>
      <p>A 2-instance of a data exchange setting is a pair (I; ), such that nulls(I) =
∅, R(a)I = 0, for all R ∈ T and a ∈ d om(I)ar(R), and = st ∪ t, where st
is a set of s-t TGDs and t is a set of t-EGDs.</p>
      <p>A 4-instance of a data exchange setting is like a 2-instance, except that st
can contain NTGD≈'s, and that R(a)I = , for all R ∈ T and a ∈ d om(I)ar(R).</p>
      <p>Let n ∈ {2; 4} and ≼ ∈ {≤; t}. An n-solution for an n-instance (I; ) of a data
exchange setting (S ∪ T; ), is an n-instance J , such that I ≼ J , J ⊧n , and
J ↾S= I↾S. The notation J ↾S stands for the instance J restricted to the relation
symbols in S, and similarly for I↾S. The set of all n-solutions to an n-instance
I in setting (S ∪ T; ) is denoted S oln(I; ). A n-solution J ∈ S oln(I; ) is
said to be an n-universal solution if J ≼ K, for all K ∈ S oln(I; ).</p>
      <p>
        Let I be a 2 instance of a data exchange setting (S ∪ T; ), and let q =
∃Y (XY) be a target UCQ, i.e. such that all relation symbols in come from T.
Then the certain answer [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] to q on (I; ) is de ned as
      </p>
      <p>C ert2(q; I;
) =  {q(J ) ∶ J ∈ S ol2(I;
)}↾ :
In other words, C ert2(q; I; ) is the greatest lower bound in the partial order
≤ of the set {q(J ) ∶ J ∈ S ol2(I; )}, restricted to the constants. The following
result is at the foundation of data exchange.</p>
      <p>
        Theorem 3. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] Let (I; ) be a data exchange setting, such that the chase with
of I terminates, and let q be a target UCQ. Then
1. J = C hase(I; ) is a 2-universal solution for (I; ).
2. C ert(q; I; ) = (q(J ))↾.
      </p>
      <p>
        In the full paper [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] we show that by a suitable reduction, any set of
NTGD≈s can be transformed into a set ↓2 of TGDs, such that for all 4-instances
I, I ⊧4 if and only if I↓2 ⊧2 ↓2. The following theorem makes the connection
between the data exchange solutions, as de ned in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], and solutions for the
intuitionistic data exchange problem.
      </p>
      <p>Theorem 4. Let (S ∪ T; ) be a data exchange setting where
st-NTGD≈s and t-EGDs, and let I be a 4-instance. Then
consists of
S ol4(I;</p>
      <p>) = S ol2(I↓2; ↓2)↑4:</p>
      <p>
        Armed with this result we now show that we can use the chase process de ned
in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] to nd a 4-universal model. As the next theorem shows, a 4-universal
solution is a good candidate to be materialized and used to compute the certain
answer for any NUCQ-query.
      </p>
      <p>Theorem 5. Let (I; ) be a 4-instance of a data exchange setting, where
consists of st-NTGD≈s and t-EGDs, Then (C hase(I↓2; ↓2))↑4 is a 4-universal
solution for (I; ). Moreover, for every NUCQ query q we have
C ert4(q; I;</p>
      <p>) = (q↓2((C hase(I↓2; ↓2))))↾↑4 :
6</p>
    </sec>
    <sec id="sec-4">
      <title>On Universal Solution Existence</title>
      <p>
        In the previous sections we have shown that for a given 4-instance I and a
set of NTGDs , (or NTGD≈~ s), the 4-universal solution is the best candidate
for target materialization in data exchange, and that as such it can be used to
e ciently compute certain answers to target UNCQ queries (or UNCQ≈ queries).
The question then arises whether a 4-universal solution exists. Since our results
include the lossless decomposition S ol4(I; ) = S ol2(I↓2; ↓2)↑4, the answer
follows directly from from [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Formally, we have
Theorem 6. 1. The problem of testing if there exists a 4-universal solution
for a given 4-instance and a set of NTGD≈s is RE-complete.
2. The problem of testing if a set of NTGD≈s has a 4-universal solution for
every 4-instance is coRE-complete.
      </p>
      <p>
        The de nition of the core-chase procedure can be found in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], from which the
next theorem follows.
      </p>
      <p>Theorem 7. The core chase procedure is complete for nding 4-universal
solutions for 4-instances I and NTGD≈s</p>
      <p>
        One of the important classes for which universal solutions are guaranteed
to exist, is the guarded dependencies of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Applying the de nition from [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ],
we say that an NTGD≈ is guarded if the body has an atom that contains all
the universally quanti ed variables. It can easily be shown that if is a set of
guarded NTGD≈s, then ↓2 is a set of guarded TGDs as well. From this and
from the elegant result of [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] it follows that
Theorem 8. A 4-universal solution always exists for a set of guarded NTGD≈s.
      </p>
      <p>
        In the literature one can nd many classes of TGDs that are known to
ensure uniform chase termination, and thus guaranteeing the existence of universal
solutions for all instances (for an overview, see e.g. [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]). Let C be such a class.
We then have
Corollary 2. Let be a set of NTGD ≈s. If ↓2 ∈ C, then a 4-universal solution
for (I; ) exists, for all 4-instances I.
      </p>
      <p>We note that most of the known classes guaranteeing uniform termination have
a tractable membership problem.
7</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>
        In this paper we have put forth a new approach to Data Exchange based on
Belnap's logic FOUR. We showed that moving to a four-valued logic comes with
the bene t of naturally extending the mapping language to NTGD≈s and the
query language to NUCQ≈s, thus allowing negation over atoms, including
equality atoms a ≈ b. We also showed that well-known techniques from Data exchange
(chase, universal solution, naive evaluation, etc) can be used in FOUR as well.
Furthermore, the core of a 4-instance I (minimal instance in size that is ≃
equivalent with I) is the same as core(I↓2)↑4. Thus the core chase [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] is complete in
nding 4-universal solutions as well. In the special case where the instances
are two-valued, the mappings are TGDs and EGDs, and the target queries are
UCQs, the semantics reduces to the classical one [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>There is still more work to be done as we haven't touched on for instance
meta-data management problems, such as composition and inverse. Another
aspect that needs to be further investigated is the chase termination problem in
T WO for a set of TGDs corresponding to a set of NTGD≈s in FOUR. Note that
the set of TGDs in this case is special in the sense that it always contain the set
of full TGDs expressed by .</p>
      <p>We believe that ⊧4 is a semantics with natural appeal, and one that can be
practically implemented over existing DBMSs.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Serge</surname>
            <given-names>Abiteboul</given-names>
          </string-name>
          , Richard Hull, and
          <string-name>
            <given-names>Victor</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>Alan</given-names>
            <surname>Anderson</surname>
          </string-name>
          , Belnap R.,
          <string-name>
            <given-names>D.</given-names>
            <surname>Nuel</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J. Michael</given-names>
            <surname>Dunn</surname>
          </string-name>
          .
          <source>Entailment: The Logic of Relevance and Necessity</source>
          , Vol. I. Princeton University Press,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Marcelo</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Leopoldo E.</given-names>
            <surname>Bertossi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Jan</given-names>
            <surname>Chomicki</surname>
          </string-name>
          .
          <article-title>Consistent query answers in inconsistent databases</article-title>
          . In Victor Vianu and
          <string-name>
            <surname>Christos H</surname>
          </string-name>
          . Papadimitriou, editors,
          <source>PODS</source>
          , pages
          <volume>68</volume>
          {
          <fpage>79</fpage>
          . ACM Press,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Ofer</given-names>
            <surname>Arieli</surname>
          </string-name>
          and
          <string-name>
            <given-names>Arnon</given-names>
            <surname>Avron</surname>
          </string-name>
          .
          <article-title>The value of the four values</article-title>
          .
          <source>Artif</source>
          . Intell.,
          <volume>102</volume>
          (
          <issue>1</issue>
          ):
          <volume>97</volume>
          {
          <fpage>141</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Jr</surname>
            . Belnap,
            <given-names>Nuel D.</given-names>
          </string-name>
          <article-title>A useful four-valued logic</article-title>
          .
          <source>In J. M~ichael Dunn and George Epstein</source>
          , editors,
          <source>Modern Uses of Multiple-Valued Logic</source>
          , volume
          <volume>2</volume>
          of Episteme, pages
          <fpage>5</fpage>
          <lpage>{</lpage>
          37. Springer Netherlands,
          <year>1977</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Andrea</given-names>
            <surname>Cal</surname>
          </string-name>
          , Georg Gottlob, and
          <string-name>
            <given-names>Michael</given-names>
            <surname>Kifer</surname>
          </string-name>
          .
          <article-title>Taming the in nite chase: Query answering under expressive relational constraints</article-title>
          .
          <source>In KR</source>
          , pages
          <volume>70</volume>
          {
          <fpage>80</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Alin</given-names>
            <surname>Deutsch</surname>
          </string-name>
          , Alan Nash, and
          <string-name>
            <surname>Je</surname>
            rey
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Remmel</surname>
          </string-name>
          .
          <article-title>The chase revisited</article-title>
          .
          <source>In PODS</source>
          , pages
          <volume>149</volume>
          {
          <fpage>158</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Ronald</given-names>
            <surname>Fagin</surname>
          </string-name>
          , Phokion G. Kolaitis,
          <string-name>
            <given-names>Renee J</given-names>
            .
            <surname>Miller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and Lucian</given-names>
            <surname>Popa</surname>
          </string-name>
          .
          <article-title>Data exchange: Semantics and query answering</article-title>
          .
          <source>In ICDT</source>
          , pages
          <volume>207</volume>
          {
          <fpage>224</fpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Melvin</given-names>
            <surname>Fitting</surname>
          </string-name>
          .
          <article-title>Bilattices and the semantics of logic programming</article-title>
          .
          <source>J. Log. Program.</source>
          ,
          <volume>11</volume>
          (
          <issue>1</issue>
          &amp;2):
          <volume>91</volume>
          {
          <fpage>116</fpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Melvin</given-names>
            <surname>Fitting</surname>
          </string-name>
          .
          <article-title>The family of stable models</article-title>
          .
          <source>J. Log. Program.</source>
          ,
          <volume>17</volume>
          (
          <issue>2</issue>
          /3&amp;4):
          <volume>197</volume>
          {
          <fpage>225</fpage>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Amelie</surname>
            <given-names>Gheerbrant</given-names>
          </string-name>
          , Leonid Libkin, and
          <string-name>
            <given-names>Cristina</given-names>
            <surname>Sirangelo</surname>
          </string-name>
          .
          <article-title>When is naive evaluation possible? In PODS</article-title>
          , pages
          <volume>75</volume>
          {
          <fpage>86</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Matthew</surname>
            <given-names>L.</given-names>
          </string-name>
          <string-name>
            <surname>Ginsberg</surname>
          </string-name>
          .
          <article-title>Bilattices and modal operators</article-title>
          . In Rohit Parikh, editor,
          <source>TARK</source>
          , pages
          <volume>273</volume>
          {
          <fpage>287</fpage>
          . Morgan Kaufmann,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. Gosta Grahne, Ali Moallemi, and
          <string-name>
            <given-names>Adrian</given-names>
            <surname>Onet</surname>
          </string-name>
          .
          <article-title>Intuitionistic data exchange</article-title>
          .
          <source>Technical report</source>
          , http://arxiv.org/.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Go</surname>
          </string-name>
          <article-title>sta Grahne and Adrian Onet. Representation systems for data exchange</article-title>
          .
          <source>In ICDT</source>
          , pages
          <volume>208</volume>
          {
          <fpage>221</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Go</surname>
          </string-name>
          <article-title>sta Grahne and Adrian Onet. The data-exchange chase under the microscope</article-title>
          .
          <source>CoRR, abs/1407.2279</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <article-title>Pavol Hell and Jaroslav Ne^setril. Graphs And Homomorphisms</article-title>
          . Oxford University Press,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <given-names>Andre</given-names>
            <surname>Hernich</surname>
          </string-name>
          .
          <article-title>Computing universal models under guarded tgds</article-title>
          .
          <source>In ICDT</source>
          , pages
          <volume>222</volume>
          {
          <fpage>235</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <article-title>Tomasz Imielinski and Witold Lipski Jr</article-title>
          .
          <article-title>Incomplete information in relational databases</article-title>
          .
          <source>J. ACM</source>
          ,
          <volume>31</volume>
          (
          <issue>4</issue>
          ):
          <volume>761</volume>
          {
          <fpage>791</fpage>
          ,
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>Thomas</given-names>
            <surname>Jech</surname>
          </string-name>
          .
          <article-title>Boolean valued models</article-title>
          .
          <source>In Handbook of Boolean Algebras</source>
          , pages
          <volume>1197</volume>
          {
          <fpage>1211</fpage>
          ,
          <year>1989</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20. Stephen Cole Kleene. Introduction to metamathematics. D. Van Norstrand,
          <year>1952</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Leonid</given-names>
            <surname>Libkin</surname>
          </string-name>
          .
          <article-title>Incomplete data: what went wrong, and how to x it</article-title>
          .
          <source>In PODS</source>
          , pages
          <volume>1</volume>
          {
          <fpage>13</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <given-names>Adrian</given-names>
            <surname>Onet</surname>
          </string-name>
          .
          <article-title>The chase procedure and its applications</article-title>
          .
          <source>PhD thesis</source>
          , Concordia University,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <given-names>Alasdair</given-names>
            <surname>Urquhart</surname>
          </string-name>
          .
          <article-title>Basic many-valued logic</article-title>
          . In D.M. Gabbay and F. Guenthner, editors,
          <source>Handbook of philosophical logic</source>
          , volume
          <volume>2</volume>
          , pages
          <fpage>249</fpage>
          {
          <fpage>295</fpage>
          . Springer Netherlands,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>