<!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>The Possibility Problem for Probabilistic XML</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Télécom ParisTech</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Institut Mines-Télécom</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>CNRS LTCI</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>We consider the possibility problem of determining if a document is a possible world of a probabilistic document, in the setting of probabilistic XML. This basic question is a special case of query answering or tree automata evaluation, but it has specific practical uses, such as checking whether an userprovided probabilistic document outcome is possible or sufficiently likely. In this paper, we study the complexity of the possibility problem for probabilistic XML models of varying expressiveness. We show that the decision problem is often tractable in the absence of long-distance dependencies, but that its computation variant is intractable on unordered documents. We also introduce an explicit matches variant to generalize practical situations where node labels are unambiguous; this ensures tractability of the possibility problem, even under long-distance dependencies, provided event conjunctions are disallowed. Our results entirely classify the tractability boundary over all considered problem variants.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        1 Translations between the probabilistic relational and XML models [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] can be used to translate
our results to complexity bounds for the POSS problem on probabilistic relational databases.
2 In fact, we will see that our hardness results always hold even for shallow documents.
may be hard to determine, because D may, in general, have many ways to generate W ,
through a possibly intractable number of different valuations of its uncertainty events.
      </p>
      <p>As a second practical example, assume that a user is editing a probabilistic XML
document D. The user notices that choosing a certain valuation of the probabilistic
events yields a certain deterministic document W , and asks whether the same document
could have been obtained by making different choices. Indeed, maybe W is considered
improbable under D following this particular valuation, but is likely overall because the
same document can be obtained through different choices. What is the probability, over
all valuations, of the user’s chosen outcome W according to D?</p>
      <p>
        On the face of it, POSS seems related to query evaluation: we wish to evaluate on D
a query qW which is, informally, “is the input document exactly W ”? However, there are
three reasons why query evaluation cannot give good complexity bounds for POSS. First,
because qW depends on the possibly large W , we are not performing query answering
for a fixed query, so we can only use the unfavorable combined complexity bounds where
both the input document D and the query qW are part of the input. Second, because we
want to obtain exactly W , the match of qW should never map two query variables to
the same node of D, so the query language must allow inequalities on node identifiers.
Third, once again because we require an exact match, we need to assert the absence of
the nodes which are not in W , so we need negation in the language. To our knowledge,
then, the only upper bound for POSS from query answering is the combined complexity
bound for the (expressive) monadic second-order logic over trees whose evaluation on
deterministic (not even probabilistic) XML trees is already PSPACE-hard [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        A second related approach is that of tree automata on probabilistic XML documents.
Indeed, we can encode the possible world W to a deterministic tree automaton AW and
compute the probability that AW accepts the probabilistic document D. The decision and
computation variants of POSS under local uncertainty models are thus special cases of
the “relevancy” and “p-acceptance” problems of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. However, their work only considers
ordered trees, and an unordered W cannot easily be translated to their deterministic tree
automata, because of possible label ambiguity: we cannot impose an arbitrary order on D
and W , as this also chooses how nodes must be disambiguated. In fact, we will show
that POSS is hard in some settings that are tractable for ordered documents.
      </p>
      <p>
        This paper specifically focuses on the POSS problem to study the precise complexity
of its different formulations. Our probabilistic XML representation is the PrXML model
of [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], noting that some results are known for the POSS problem (called the “membership
problem”) in the incomparable and substantially different “open-world” incomplete
XML model of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (whose documents have an infinite set of possible worlds, instead of
a possibly exponential but finite set as in PrXML).
      </p>
      <p>
        We start by defining the required preliminaries in Section 2 and the different variants
of POSS in Section 3, establishing its overall NP-completeness and reviewing the results
of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We then study local uncertainty models in Section 4 and show that the absence
of order impacts tractability, with a different picture for the decision and computation
variants of POSS. Last, in Section 5, we show that POSS can be made tractable under
longdistance event correlations, by disallowing event conjunctions and imposing an “explicit
matches” condition which generalizes, e.g., unique node labels. We then conclude in
Section 6. For lack of space, all proofs are deferred to the extended version [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>We start by formally defining XML documents and probability distributions over them:</p>
      <sec id="sec-2-1">
        <title>Definition 1. An unordered XML document is an unordered tree whose nodes carry a</title>
        <p>label from a set L of labels. Ordered XML documents are defined in the same way but
with ordered trees, that is, there is a total order over the children of every node.</p>
        <sec id="sec-2-1-1">
          <title>A probability distribution is a function P mapping every XML document x from a</title>
          <p>finite set supp(P) to a rational number P(x), its probability according to P, with the
condition that åD2supp(P) P(D) = 1. For any x 2= supp(P) we write P(x) = 0.</p>
          <p>
            As it is unwieldy to manipulate explicit probability distributions over large sets
of documents, we use the language of probabilistic XML [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ] to write extended XML
documents (with so-called probabilistic nodes) and give them a semantics which is a
(possibly exponentially larger) probability distribution over XML documents.
Definition 2. A PrXML probabilistic XML document D is an XML document over
L t fdet; ind; mux; cie; eg, where every edge from a mux or ind node to a child node is
labeled with some rational number3 0 &lt; x &lt; 1 (the sum of the labels of the children of
every mux node being 1), and every edge from a cie (resp. e) node to a child node is
labeled with a conjunction (resp. a Boolean formula) of events from a set E of events
(and their negations), with a mapping p : E ! [0; 1] attributing a rational probability
to every event. The nodes with labels from L are called regular nodes, by opposition to
probabilistic nodes. We assume that the root of D is a regular node.
          </p>
        </sec>
        <sec id="sec-2-1-2">
          <title>For any subset L fdet; ind; mux; cie; eg, we call PrXMLL the language of probabilistic XML documents containing only nodes with labels in L t L.</title>
          <p>
            The semantics of a PrXML document D is the probability distribution over XML
documents defined by the following sampling process (see [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ] for more details):
Definition 3. A deterministic XML document W is obtained from a PrXML document D
as follows. First, choose a valuation n : E ! ft; fg of the events from E, with probability
Õe s:t:n(e)=t p(e) Õe s:t:n(e)=f(1 p(e)). Evaluate cie and e nodes by keeping only
the child edges whose Boolean formula is true under n. Evaluate ind nodes by choosing
to keep or delete every child edge according to the probability indicated on its edge
label. Evaluate mux nodes by removing all of their children edges, except one chosen
according to its probability (possibly keep none if the probabilities sum up to less than 1).
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Finally, evaluate det nodes by replacing them by the collection of their children.</title>
      </sec>
      <sec id="sec-2-3">
        <title>All probabilistic choices are performed independently, so the overall probability of</title>
        <p>an outcome is the product of the probabilities at each step. Whenever an edge is removed,
all of the descendant nodes and edges are removed. The probability of a document W
according to D, written D(W ), is the total probability of all outcomes4 leading to W .</p>
        <p>
          Of course, the expressiveness and compactness of PrXML frameworks depend
on which probabilistic nodes are allowed: we say that PrXMLC is more general than
PrXMLD if there is a polynomial time algorithm to rewrite any PrXMLD document
to a PrXMLC document representing the same probability distribution. Fig. 1 (adapted
from [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]) represents this hierarchy on the PrXML classes that we consider.
3 The non-standard constraint x &lt; 1 means that ind does not subsume det (see Thm. 3 and 4).
4 Note that in general there may be multiple outcomes that lead to the same document W .
mux; ind; det
        </p>
        <p>mie
ind; det mux; ind mux; det</p>
        <p>e
cie
ind</p>
        <p>mux
0/</p>
        <p>Complexity
&gt;
#PPOOSSSS &gt;&gt; ee FNPP#P ((PPrroopp.. 11)) &lt; 6&lt;
#POSS &lt; mux; ind; det PTIME (Thm. 1)
#POSS 6&lt; ind or mux #P-hard (Thm. 2) ?
POSS &gt; ind or mux PTIME (Thm. 3) #POSS</p>
        <p>POSS 6&lt; 2 of mux; ind; det NP-hard (Thm. 4)
#EPOSS &gt; mux; ind; det PTIME (Thm. 5) POSS #EPOSS
EPOSS ? cie NP-hard (Thm. 6)</p>
        <p>POSS ? mie NP-hard (Thm. 7) EPOSS
#EPOSS &gt; mie PTIME (Thm. 8)</p>
      </sec>
      <sec id="sec-2-4">
        <title>Definition 4. Given a class PrXMLC, the possibility problem for unordered documents</title>
        <p>POSS6C&lt; is to determine, given as input an unordered PrXMLC document D and an
unordered XML document W , whether W is a possible world of D, namely, D(W ) &gt; 0.</p>
        <p>The possibility problem for ordered documents POSSC&lt; is the same problem except
that both D and W are ordered. For o 2 f6&lt;; &lt;g, the #POSSoC problem is the counting
variant of POSSoC, whose output is D(W ).</p>
        <p>For brevity, we write POSSC? and POSSC&gt; when describing lower or upper complexity
bounds that apply to both POSSC&lt; and POSS6C&lt;.</p>
        <p>We start by giving straightforward bounds on the most general problem variants:
Prop. 1. POSS&gt;e is in NP and #POSS&gt;e is in FP#P.</p>
        <p>Prop. 2. POSSc?ie is NP-complete, even when D has height 3.</p>
        <p>
          Local models on ordered documents are known to be tractable using tree automata:
Theorem 1 ([
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]). #POSS&lt;mux;ind;det can be solved in polynomial time.
4
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Local models</title>
      <p>
        We now complete the picture for the local model PrXMLmux;ind;det on unordered
documents. The results of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] cannot be applied to this setting, as the ambiguity of node labels
imply that we cannot impose an arbitrary order on document nodes; indeed, a reduction
from perfect matching counting on bipartite graphs shows that the computation variant
is hard even on the most inexpressive classes:
Theorem 2. #POSSi&lt;nd and #POSS&lt;mux are #P-hard, even when D has height 4.
      </p>
      <p>6 6</p>
      <p>By contrast, the decision variant is tractable for PrXMLind and PrXMLmux, using a
dynamic algorithm. However, allowing both ind and mux, or allowing det nodes, leads
to intractability (by reductions from set cover and Boolean satisfiability).
Theorem 3. POSSi&gt;nd and POSS&gt;mux can be decided in PTIME.</p>
      <p>Theorem 4. POSSi&lt;nd;det, POSS&lt;mux;det and POSS&lt;mux;ind are NP-complete, even when
D has height 4. 6 6 6</p>
    </sec>
    <sec id="sec-4">
      <title>Explicit matches</title>
      <p>We now attempt to understand how the overall hardness of POSS is caused by the
difficulty of finding how the possible world W can be matched to D.</p>
      <sec id="sec-4-1">
        <title>Definition 5. A candidate match of W in D is an injective mapping f from the nodes</title>
        <p>of W to the regular nodes of D such that, if r is the root of W then f (r) is the root of D,
and if n is a child of n0 in W then there is a descending path from f (n) to f (n0) going
only through probabilistic nodes.</p>
        <p>Intuitively, candidate matches are possible ways to generate W from D, ignoring
probabilistic annotations, assuming we can keep exactly the regular nodes of D that are
in the image of f . There are exponentially many candidate matches in general, so it is
natural to ask whether POSS is tractable if all matches are explicitly provided as input:</p>
        <sec id="sec-4-1-1">
          <title>Definition 6. Given a class PrXMLC and o 2 f?; 6&lt;; &lt;; &gt;g, the POSS problem with</title>
          <p>explicit matches EPOSSoC is the same as the POSSoC problem except that the set of the
candidate matches of W in D is provided as input (in addition to D and W ).</p>
          <p>The explicit matches variant generalizes many practical cases where all possible
matches can be computed in polynomial time; for instance, when node labels are assumed
to be unique, or unambiguous in the sense that no two sibling nodes carry the same label.</p>
          <p>
            We first note that explicit matches ensure tractability of all local dependency models,
by reduction to deterministic tree automata [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ], this time also for unordered documents.
Intuitively, we can consider all candidate matches separately and compute the probability
of each one, in which case no label ambiguity remains so any order can be imposed:
Theorem 5. #EPOSS&gt;mux;ind;det can be solved in polynomial time.
          </p>
          <p>For long-distance dependencies, however, it is easily seen that POSS is still hard with
conjunction of events, even if explicit matches are provided:
Theorem 6. EPOSSc?ie is NP-complete, even when D has height 3.</p>
          <p>This being said, it turns out that the hardness is really caused by event conjunctions.
To see this, we introduce the PrXMLmie class, which allows only individual events:
Definition 7. The PrXMLmie class features multivalued independent events taking their
values from a finite set V (beyond t and f, with probabilities summing to 1), and
probabilistic mie nodes whose child edges are annotated by a single event e and a value x 2 V .</p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>A mie node cannot be the child of a mie node. When evaluating D under a valuation n, child edges of mie nodes labeled (e; x) should be kept if and only if n(e) = x.</title>
        <p>Note that mie hierarchies are forbidden (because they can straightforwardly encode
conjunctions), so that PrXMLmie does not capture ind hierarchies. However, as we
introduced it with multivalued (not just Boolean) events, it captures PrXMLmux:
Prop. 3. We can rewrite PrXMLmux to PrXMLmie and PrXMLmie to PrXMLcie in PTIME.</p>
        <p>In the PrXMLmie class, the POSS problem is still NP-hard, by reduction to exact
cover; however, with explicit matches, the #POSS problem is tractable, both in the
ordered and unordered setting, despite the long-distance dependencies. Intuitively, the
candidate matches are mutually exclusive, and each match’s probability can be computed
as that of a conjunction of equalities and inequalities on the events at the frontier.
Theorem 7. POSS?mie is NP-complete, even when D has height 3 and events are Boolean.
Theorem 8. #EPOSS&gt;mie can be solved in polynomial time.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>We have characterized the complexity of the counting and decision variants of POSS
for unordered or ordered XML documents, and various PrXML classes. With explicit
matches, #POSS is tractable unless event conjunctions are allowed. Without explicit
matches, POSS is hard unless dependencies are local; in this case, if the documents are
ordered, #POSS is tractable, otherwise #POSS is hard and POSS is tractable only with
ind or mux nodes (and hard if both types, or det nodes, are allowed). Our results are
summarized in Table 1 on page 4.</p>
      <p>
        Further work could study more precisely the effect of det nodes and ind hierarchies,
for instance by attempting to extend the PrXMLmie class to capture them, or try to
understand whether there is a connection between the algorithms of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and the proof
of Thm. 3. It would also be interesting to determine under which conditions (beyond
unique labels) can candidate matches be enumerated in polynomial time, so that the
POSS problem reduces to the explicit matches variant. Last but not least, another natural
problem setting is to allow the order on sibling nodes of D to be partly specified.
This question is already covered in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], but only when all of the possible orderings
are explicitly enumerated: investigating the tractability of POSS for more compact
representations, such as partial orders, is an intriguing problem.
      </p>
      <p>Acknowledgements. The author thanks Pierre Senellart for careful proofreading, useful
suggestions, and insightful feedback, the anonymous referees for their valuable
comments, and M. Lamine Ba and Tang Ruiming for helpful early discussion. This work has
been partly funded by the French government under the X-Data project.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>A.</given-names>
            <surname>Amarilli</surname>
          </string-name>
          .
          <article-title>The possibility problem for probabilistic XML (extended version)</article-title>
          .
          <source>CoRR</source>
          ,
          <year>2014</year>
          . http://arxiv.org/abs/1404.3131.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Amarilli</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Senellart</surname>
          </string-name>
          .
          <article-title>On the connections between relational and XML probabilistic data models</article-title>
          .
          <source>In Proc. BNCOD</source>
          , pages
          <fpage>121</fpage>
          -
          <lpage>134</lpage>
          , Oxford, United Kingdom,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>M. L. Ba</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Abdessalem</surname>
            , and
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Senellart</surname>
          </string-name>
          .
          <article-title>Merging uncertain multi-version XML documents</article-title>
          .
          <source>Proc. DChanges</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>M. L. Ba</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Abdessalem</surname>
            , and
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Senellart</surname>
          </string-name>
          .
          <article-title>Uncertain version control in open collaborative editing of tree-structured documents</article-title>
          .
          <source>In Proc. DocEng</source>
          , pages
          <fpage>27</fpage>
          -
          <lpage>36</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>P.</given-names>
            <surname>Barceló</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Poggi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Sirangelo</surname>
          </string-name>
          .
          <article-title>XML with incomplete information</article-title>
          .
          <source>JACM</source>
          ,
          <volume>58</volume>
          (
          <issue>1</issue>
          ):
          <fpage>4</fpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>S.</given-names>
            <surname>Cohen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Kimelfeld</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Sagiv</surname>
          </string-name>
          .
          <article-title>Running tree automata on probabilistic XML</article-title>
          .
          <source>In Proc. PODS</source>
          , pages
          <fpage>227</fpage>
          -
          <lpage>236</lpage>
          . ACM,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>E.</given-names>
            <surname>Kharlamov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Nutt</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Senellart</surname>
          </string-name>
          .
          <article-title>Updating probabilistic XML</article-title>
          .
          <source>In Proc. Updates</source>
          in
          <string-name>
            <surname>XML</surname>
          </string-name>
          , Lausanne, Switzerland,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>B.</given-names>
            <surname>Kimelfeld</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Kosharovsky</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Sagiv</surname>
          </string-name>
          .
          <article-title>Query evaluation over probabilistic XML</article-title>
          .
          <source>VLDB Journal</source>
          ,
          <volume>18</volume>
          (
          <issue>5</issue>
          ):
          <fpage>1117</fpage>
          -
          <lpage>1140</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>B.</given-names>
            <surname>Kimelfeld</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Senellart</surname>
          </string-name>
          .
          <article-title>Probabilistic XML: Models and complexity</article-title>
          . In Z. Ma and L. Yan, editors,
          <source>Advances in Probabilistic Databases for Uncertain Information Management</source>
          , pages
          <fpage>39</fpage>
          -
          <lpage>66</lpage>
          . Springer-Verlag,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          .
          <source>Elements of Finite Model Theory</source>
          . Springer,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>D.</given-names>
            <surname>Suciu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Olteanu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Ré</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Koch</surname>
          </string-name>
          . Probabilistic Databases. Morgan &amp; Claypool,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>