scispace - formally typeset
Open AccessProceedings ArticleDOI

Efficient static analysis of XML paths and types

TLDR
An algorithm to solve XPath decision problems under regular tree type constraints and its use to statically type-check XPath queries is presented and the decidability of a logic with converse for finite ordered trees is proved.
Abstract
We present an algorithm to solve XPath decision problems under regular tree type constraints and show its use to statically type-check XPath queries. To this end, we prove the decidability of a logic with converse for finite ordered trees whose time complexity is a simple exponential of the size of a formula. The logic corresponds to the alternation free modal μ-calculus without greatest fixpoint, restricted to finite trees, and where formulas are cycle-free.Our proof method is based on two auxiliary results. First, XML regular tree types and XPath expressions have a linear translation to cycle-free formulas. Second, the least and greatest fixpoints are equivalent for finite trees, hence the logic is closed under negation.Building on these results, we describe a practical, effective system for solving the satisfiability of a formula. The system has been experimented with some decision problems such as XPath emptiness, containment, overlap, and coverage, with or without type constraints. The benefit of the approach is that our system can be effectively used in static analyzers for programming languages manipulating both XPath expressions and XML type annotations (as input and output types).

read more

Content maybe subject to copyright    Report

HAL Id: hal-00189123
https://hal.archives-ouvertes.fr/hal-00189123
Submitted on 20 Nov 2007
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entic research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diusion de documents
scientiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Ecient Static Analysis of XML Paths and Types
Pierre Genevès, Nabil Layaïda, Alan Schmitt
To cite this version:
Pierre Genevès, Nabil Layaïda, Alan Schmitt. Ecient Static Analysis of XML Paths and Types.
Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implemen-
tation, Jun 2007, San Diego, United States. pp.342–351, �10.1145/1250734.1250773�. �hal-00189123�

Efficient Static Analysis of XML Paths and Types
Pierre Genev
`
es
Ecole Polytechnique F
´
ed
´
erale de Lausanne
pierre.geneves@epfl.ch
Nabil Laya
¨
ıda Alan Schmitt
INRIA Rh
ˆ
one-Alpes
{nabil.layaida, alan.schmitt}@inria.fr
Abstract
We present an algorithm to solve XPath decision problems under
regular tree type constraints and show its use to statically type-
check XPath queries. To this end, we prove the decidability of a
logic with converse for finite ordered trees whose time complexity
is a simple exponential of the size of a formula. The logic cor-
responds to the alternation free modal µ-calculus without greatest
fixpoint, restricted to finite trees, and where formulas are cycle-free.
Our proof method is based on two auxiliary results. First, XML
regular tree types and XPath expressions have a linear translation
to cycle-free formulas. Second, the least and greatest fixpoints are
equivalent for finite trees, hence the logic is closed under negation.
Building on these results, we describe a practical, effective
system for solving the satisfiability of a formula. The system has
been experimented with some decision problems such as XPath
emptiness, containment, overlap, and coverage, with or without
type constraints. The benefit of the approach is that our system can
be effectively used in static analyzers for programming languages
manipulating both XPath expressions and XML type annotations
(as input and output types).
Categories and Subject Descriptors E.1 [Data Structures]: Trees;
F.4.1 [Mathematical Logic and Formal Languages]: Mathemat-
ical Logic—modal logic; F.4.3 [Mathematical Logic and For-
mal Languages]: Formal Languages—decision problems; H.2.1
[Database Management]: Logical Design; H.2.3 [Database Man-
agement]: Languages—Query Languages
General Terms Algorithms, languages, theory, verification
Keywords Modal logic, satisfiability, type checking, XPath
1. Introduction
This work is motivated by the need of efficient type checkers for
XML-based programming languages where XML types and XPath
queries are used as first class language constructs. In such settings,
XPath decision problems in the presence of XML types such as
DTDs or XML Schemas arise naturally. Examples of such decision
problems include emptiness test (whether an expression ever se-
lects nodes), containment (whether the results of an expression are
always included in the results of another one), overlap (whether two
Major part of this work done when the author was at INRIA Rh
ˆ
one-Alpes.
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation
on the first page. To copy otherwise, to republish, to post on servers or to redistribute
to lists, requires prior specific permission and/or a fee.
PLDI’07 June 11–13, 2007, San Diego, California, USA.
Copyright
c
2007 ACM 978-1-59593-633-2/07/0006. . . $5.00
expressions select common nodes), and coverage (whether nodes
selected by an expression are always contained in the union of the
results selected by several other expressions).
XPath decision problems are not trivial in that they need to be
checked on a possibly infinite quantification over a set of trees. An-
other difficulty arises from the combination of upward and down-
ward navigation on trees with recursion [31].
The most basic decision problem for XPath is the emptiness
test of an expression [3]. This test is important for optimization of
host languages implementations: for instance, if one can decide at
compile time that a query result is empty then subsequent bound
computations can be ignored. Another basic decision problem is
the XPath equivalence problem: whether or not two queries always
return the same result. It is important for reformulation and opti-
mization of an expression [17] , which aim at enforcing operational
properties while preserving semantic equivalence [23]. The most
essential problem for type-checking is XPath containment. It is re-
quired for the control-flow analysis of XSLT [25], for checking in-
tegrity constraints, and for XML security [12].
The complexity of XPath decision problems heavily depends on
the language features. Previous works [28, 3] showed that including
general comparisons of data values from an infinite domain may
lead to undecidability. Therefore, we focus on a XPath fragment
which covers all features except counting [8] and data values.
In our approach to solve XPath decision problems, two issues
need to be addressed. First, we identify the most appropriate logic
with sufficient expressiveness to capture both regular tree types and
our XPath fragment. Second, we solve efficiently the satisfiability
problem which allows to test if a given formula of the logic admits
a satisfying finite tree.
The essence of our results lives in a sub-logic of the alternation
free modal µ-calculus (AFMC) with converse, some syntac tic re-
strictions on formulas, without greatest fixpoint, and whose models
are finite trees. We prove that XPath expressions and regular tree
type formulas conform to these syntactic restrictions. Boolean clo-
sure is the key property for solving the containment (a logical im-
plication). In order to obtain closure under negation, we prove that
the least and greatest fixpoint operators collapse in a single fixpoint
operator. Surprisingly, the translations of XML regular tree types
and a large XPath fragment does not increase complexity since they
are linear in the size of the corresponding formulas in the logic. The
combination of these ingredients lead to our main result: a satisfi-
ability algorithm for a logic for finite trees whose time complexity
is a simple exponential of the size of a formula.
The decision procedure has been implemented in a system for
solving XML decision problems such as XPath emptiness, con-
tainment, overlap, and coverage, with or without XML type con-
straints. The system can be used as a component of static analyzers
for programming languages manipulating XPath expressions and
XML type annotations for both input and output.

2. Outline
The paper is organized as follows. We first present our data model,
trees with focus, and our logic in §3 and §4. We next present XPath
and its translation in our logic in §5. Our satisfiability algorithm
is introduced and proven correct in §6, and a few details of the
implementation are discussed in §7. Applications for type checking
and some experimental results are described in §8. We study related
work in §9 and conclude in §10.
Detailed proofs and implementation techniques can be found in
a long version of this paper [16].
3. Trees with Focus
In order to represent XML trees that are easy to navigate we use fo-
cused trees, inspired by Huet’s Zipper data structure [20]. Focused
trees not only describe a tree but also its context: its previous sib-
lings and its parent, including its parent context recursively. Explor-
ing such a structure has the advantage to preserve all information,
which is quite useful when considering languages such as XPath
that allow forward and backward axes of navigation.
Formally, we assume an alphabet Σ of labels, ranged over by σ.
t ::= σ[tl] tree
tl ::= list of trees
empty list
| t :: tl cons cell
c ::= context
(tl, Top, tl) root of the tree
| (tl, c[σ], tl ) context node
f ::= (t, c) focused tree
In order to deal with decision problems such as containment, we
need to represent in a focused tree the place where the evaluation
was started using a start mark, often simply called “mark” in the
following. To do so, we consider focused trees where a single tree
or a single context node is marked, as in σ
s
[tl] or (tl , c[σ
s
], tl ).
When the presence of the mark is unknown, we write it as σ
[tl].
We write F for the set of finite focused trees with a single mark.
The name of a focused tree is defined as nm(σ
[tl], c) = σ.
We now describe how to navigate focused trees, in binary style.
There are four directions that can be followed: for a focused tree f,
f h1i changes the focus to the children of the current tree, f h2i
changes the focus to the next sibling of the current tree, f
˙
1
¸
changes the focus to the parent of the tre e if the current tree is
a leftmost sibling, and f
˙
2
¸
changes the focus to the previous
sibling.
Formally, we have:
(σ
[t :: tl ], c) h1i
def
= (t, (, c[σ
], tl ))
(t, (tl
l
, c[σ
], t
0
:: tl
r
)) h2i
def
= (t
0
, (t :: tl
l
, c[σ
], tl
r
))
(t, (, c[σ
], tl ))
˙
1
¸
def
= (σ
[t :: tl ], c)
(t
0
, (t :: tl
l
, c[σ
], tl
r
))
˙
2
¸
def
= (t, (tl
l
, c[σ
], t
0
:: tl
r
))
When the focused tree does not have the required shape, these
operations are not defined.
4. The Logic
We introduce in this section the logic to which XPath expressions
and XML regular tree types are going to be translated, a sub-logic
of the alternation free modal µ-calculus with converse. We also
introduce a restriction on the formulas we consider and give an
interpretation of formulas as sets of finite focused trees. We finally
show that the logic has a single fixpoint for these models and that
it is closed under negation.
L
µ
3 ϕ, ψ ::= formula
> true
| σ | ¬σ atomic prop (negated)
| s | ¬s start prop (negated)
| X variable
| ϕ ψ disjunction
| ϕ ψ conjunction
| hai ϕ | ¬ hai > existential (negated)
| µX
i
i
in ψ least n-ary fixpoint
| νX
i
i
in ψ greatest n-ary fixpoint
Figure 1. Logic formulas
J>K
V
def
= F JσK
V
def
= {f | nm(f) = σ}
JXK
V
def
= V (X) J¬σK
V
def
= {f | nm(f) 6= σ}
Jϕ ψK
V
def
= JϕK
V
JψK
V
JsK
V
def
=
n
f | f = (σ
s
[tl], c)
o
Jϕ ψK
V
def
= JϕK
V
JψK
V
J¬sK
V
def
= {f | f = (σ[tl ], c)}
Jhai ϕK
V
def
= {f hai | f JϕK
V
f hai defined}
J¬ hai >K
V
def
= {f | f hai undefined}
JµX
i
i
in ψK
V
def
= let T
i
=
\
n
T
i
F | Jϕ
i
K
V [T
i
/X
i
]
T
i
o”
i
in JψK
V [T
i
/X
i
]
JνX
i
i
in ψK
V
def
= let T
i
=
[
n
T
i
F | T
i
Jϕ
i
K
V [T
i
/X
i
]
o”
i
in JψK
V [T
i
/X
i
]
Figure 2. Interpretation of formulas
In the following definitions, a {1, 2, 1, 2} are programs and
atomic propositions σ correspond to labels from Σ. We also assume
that a = a. Formulas defined in Fig. 1 include the truth predicate,
atomic propositions (denoting the name of the tree in focus), start
propositions (denoting the presence of the start mark), disjunction
and conjunction of formulas, formulas under an existential (denot-
ing the existence a subtree satisfying the sub-formula), and least
and greatest n-ary fixpoints. We chose to include a n-ary version of
fixpoints because regular types are often defined as a set of mutu-
ally recursive definitions, making their translation in our logic more
succinct. In the following we write µX.ϕ for µX in ϕ”.
We define in Fig. 2 an interpretation of our formulas as sets of fi-
nite focused trees with a single start mark. The interpretation of the
n-ary fixpoints first compute the smallest or largest interpretation
for each ϕ
i
then returns the interpretation of ψ.
We now restrict the set of valid formulas to cycle-free formulas,
i.e. formulas that have a bound on the number of modality cycles
independently of the number of unfolding of their fixpoints. A
modality cycle is a subformula of the form hai ϕ where ϕ contains
a top-level existential of the form hai ψ. (By “top-level” we mean
under an arbitrary number of conjunctions or disjunctions, but not
under any other construct.) For instance, the formula µX. h1i (ϕ
˙
1
¸
X) in X is not cycle free: for any integer n, there is an
unfolding of the formula with n modality cycles. On the other hand,
the formula µX. h1i (X Y ), Y.
˙
1
¸
(Y >) in X is cycle free:
there is at most one modality cycle.
Cycle-free formulas have a very interesting property, which we
now describe. To test whether a tree satisfies a formula, one may

define a straightforward inductive relation between trees and for-
mulas that only holds when the root of the tree satisfies the formula,
unfolding fixpoints if necessary. Given a tree, if a formula ϕ is cy-
cle free, then every node of the tree will be tested a finite number
of time against any given subformula of ϕ. The intuition behind
this property, which holds a central role in the proof of lemma 4.2,
is the following. If a tree node is tested an infinite number of times
against a subformula, then there must be a cycle in the navigation in
the tree, corresponding to some modalities occurring in the subfor-
mula, between one occurrence of the test and the next one. As we
consider trees, the cycle implies there is a modality cycle in the for-
mula (as cycles of the form h1i h2i
˙
1
¸˙
2
¸
cannot occur). Hence
the number of modality cycles in any expansion of ϕ is unbounded,
thus the formula is not cycle free.
We are now ready to show a first result: in the finite focused-tree
interpretation, the least and greatest fixpoints coincide for cycle-
free formulas. To this end, we prove a stronger result that states
that a given focused tree is in the interpretation of a formula if it
is in a finite unfolding of the formula. In the base case, we use the
formula σ ¬σ as “false”.
DEFINITION 4.1 (Finite unfolding). The finite unfolding of a for-
mula ϕ is the set unf (ϕ) inductively defined as
unf (ϕ)
def
= {ϕ} for ϕ = >, σ, ¬σ, s, ¬s, X, ¬ hai >
unf (ϕ ψ)
def
=
˘
ϕ
0
ψ
0
| ϕ
0
unf (ϕ), ψ
0
unf (ψ)
¯
unf (ϕ ψ)
def
=
˘
ϕ
0
ψ
0
| ϕ
0
unf (ϕ), ψ
0
unf (ψ)
¯
unf (hai ϕ)
def
=
˘
hai ϕ
0
| ϕ
0
unf (ϕ)
¯
unf (µX
i
i
in ψ)
def
= unf (ψ{
µX
i
i
in X
i
/
X
i
}) {σ ¬σ}
unf (νX
i
i
in ψ)
def
= unf (ψ{
νX
i
i
in X
i
/
X
i
}) {σ ¬σ}
LEMMA 4.2. Let ϕ a cycle-free formula, then JϕK
V
= Junf (ϕ)K
V
.
The reason why this lemma holds is the following. Given a tree
satisfying ϕ, we deduce from the hypothesis that ϕ is cycle free
the fact that every node of the tree will be tested a finite number of
times against every subformula of ϕ. As the tree and the number
of subformulas are finite, the satisfaction derivation is finite hence
only a finite number of unfolding is necessary to prove that the tree
satisfies the formula, which is what the lemma states. As least and
greatest fixpoints coincide when only a finite number of unfolding
is required, this is sufficient to show that they collapse. Note that
this would not hold if infinite trees were allowed: the formula
µX. h1i X is cycle free, but its interpretation is empty, whereas
the interpretation of νX. h1i X includes every tree with an infinite
branch of h1i children.
We now illustrate why formulas need to be cycle free for the
fixpoints to collapse. Consider the formula µX. h1i
˙
1
¸
X. Its in-
terpretation is empty. The interpretation of νX. h1i
˙
1
¸
X however
contains every focused tree that has one h1i child.
In the rest of the paper, we only consider least fixpoints. An
important consequence of Lemma 4.2 is that the logic restricted
in this way is closed under negation using De Morgan’s dualities,
extended to eventualities and fixpoints as follows:
¬ hai ϕ
def
= ¬ hai > hai ¬ϕ
µX
i
i
in ψ
def
= µX
i
.¬ϕ
i
{
X
i
/
¬X
i
} in ¬ψ{
X
i
/
¬X
i
}
5. XPath and Regular Tree Languages
XPath [6] is a powerful language for navigating in XML documents
and selecting sets of nodes matching a predicate. In their simplest
form, XPath expressions look like “directory navigation paths”. For
L
XPath
3 e ::= XPath expression
/p absolute path
| p relative path
| e
1
p e
2
union
| e
1
e
2
intersection
Path p ::= path
p
1
/p
2
path composition
| p[q] qualified path
| a::σ step with node test
| a:: step
Qualif q ::= qualifier
q
1
and q
2
conjunction
| q
1
or q
2
disjunction
| not q negation
| p path
Axis a ::= tree navigation axis
child | self | parent
| descendant | desc-or-self
| ancestor | anc-or-self
| foll-sibling | prec-sibling
| following | preceding
Figure 3. XPath Abstract Syntax.
example, the XPath expression
/child::book/child::chapter/child::section
navigates from the root of a document (designated by the lead-
ing “/”) through the top-level “book” node to its “chapter” child
nodes and on to its child nodes named “section”. The result of the
evaluation of the entire expression is the set of all the “section”
nodes that can be reached in this manner. The situation becomes
more interesting when combined with XPath’s capability of search-
ing along “axes” other than “child”. For instance, one may use the
“preceding-sibling” axis for navigating backward through nodes of
the same parent, or the “ancestor” axis for navigating upward re-
cursively. Furthermore, at each step in the navigation the selected
nodes can be filtered using qualifiers: boolean expression between
brackets that can test the existence or absence of paths.
We consider a large XPath fragment covering all major features
of the XPath recommendation [6] except counting and comparisons
between data values.
Fig. 3 gives the syntax of XPath expressions. Fig. 4 gives an
interpretation of XPath expressions as functions between sets of
focused trees.
5.1 XPath Embedding
We now explain how an XPath expression can be translated into an
equivalent L
µ
formula that performs navigation in focused trees in
binary style.
Logical Interpretation of Axes The translation of navigational
primitives (namely XPath axes) is formally specified in Fig. 5. The
translation function, noted A
JaK
χ
”, takes an XPath axis a as
input, and returns its L
µ
translation, parameterized by the L
µ
for-
mula χ given as parameter. This parameter represents the context
in which the axis occurs and is needed for formula composition
in order to translate path composition. More precisely, the formula
A
JaK
χ
holds for all nodes that can be accessed through the axis
a from some node verifying χ.
Let us consider an example. The formula A
JchildK
χ
, trans-
lated as µZ.
˙
1
¸
χ
˙
2
¸
Z, is satisfied by children of the context
χ. These nodes consist of the first child and the remaining chil-
dren. From the first child, the context must be reached immediately

S
e
J·K
·
: L
XPath
2
F
2
F
S
e
J/pK
F
def
= S
p
JpK
root(F )
S
e
JpK
F
def
= S
p
JpK
{(σ
s
[tl ],c)F }
S
e
Je
1
p e
2
K
F
def
= S
e
Je
1
K
F
S
e
Je
2
K
F
S
e
Je
1
e
2
K
F
def
= S
e
Je
1
K
F
S
e
Je
2
K
F
S
p
J·K
·
: Path 2
F
2
F
S
p
Jp
1
/p
2
K
F
def
=
n
f
0
| f
0
S
p
Jp
2
K
(
S
p
Jp
1
K
F
)
o
S
p
Jp[q]K
F
def
= {f | f S
p
JpK
F
S
q
JqK
f
}
S
p
Ja::σK
F
def
= {f | f S
a
JaK
F
nm(f) = σ}
S
p
Ja::K
F
def
= {f | f S
a
JaK
F
}
S
q
J·K
·
: Qualif F {true, false}
S
q
Jq
1
and q
2
K
f
def
= S
q
Jq
1
K
f
S
q
Jq
2
K
f
S
q
Jq
1
or q
2
K
f
def
= S
q
Jq
1
K
f
S
q
Jq
2
K
f
S
q
Jnot qK
f
def
= ¬ S
q
JqK
f
S
q
JpK
f
def
= S
p
JpK
{f}
6=
S
a
J·K
·
: Axis 2
F
2
F
S
a
JselfK
F
def
= F
S
a
JchildK
F
def
= fchild(F) S
a
Jfoll-siblingK
fchild(F )
S
a
Jfoll-siblingK
F
def
= nsibling(F) S
a
Jfoll-siblingK
nsibling(F )
S
a
Jprec-siblingK
F
def
= psibling(F) S
a
Jprec-siblingK
psibling(F )
S
a
JparentK
F
def
= parent(F)
S
a
JdescendantK
F
def
= S
a
JchildK
F
S
a
JdescendantK
(S
a
JchildK
F
)
S
a
Jdesc-or-selfK
F
def
= F S
a
JdescendantK
F
S
a
JancestorK
F
def
= S
a
JparentK
F
S
a
JancestorK
(S
a
JparentK
F
)
S
a
Janc-or-selfK
F
def
= F S
a
JancestorK
F
S
a
JfollowingK
F
def
= S
a
Jdesc-or-selfK
(
S
a
Jfoll-siblingK
(S
a
Janc-or-selfK
F
)
)
S
a
JprecedingK
F
def
= S
a
Jdesc-or-selfK
(
S
a
Jprec-siblingK
(S
a
Janc-or-selfK
F
)
)
fchild(F )
def
= {f h1i | f F f h1i defined}
nsibling(F )
def
= {f h2i | f F f h2i defined}
psibling(F )
def
=
˘
f
˙
2
¸
| f F f
˙
2
¸
defined
¯
parent(F )
def
= {(σ
[rev a(tl
l
, t :: tl
r
)], c)
| (t, (tl
l
, c[σ
], tl
r
)) F }
rev a(, tl
r
)
def
= tl
r
rev a(t :: tl
l
, tl
r
)
def
= rev a(tl
l
, t :: tl
r
)
root(F )
def
= {(σ
s
[tl], (tl , Top, tl)) F }
root(parent(F ))
Figure 4. Interpretation of XPath in terms of Focused Trees.
A
J·K
·
: Axis L
µ
L
µ
A
JselfK
χ
def
= χ
A
JchildK
χ
def
= µZ.
˙
1
¸
χ
˙
2
¸
Z
A
Jfoll-siblingK
χ
def
= µZ.
˙
2
¸
χ
˙
2
¸
Z
A
Jprec-siblingK
χ
def
= µZ. h2i χ h2i Z
A
JparentK
χ
def
= h1i µZ.χ h2i Z
A
JdescendantK
χ
def
= µZ.
˙
1
¸
(χ Z)
˙
2
¸
Z
A
Jdesc-or-selfK
χ
def
= µZ.χ µY.
˙
1
¸
(Y Z)
˙
2
¸
Y
A
JancestorK
χ
def
= h1i µZ.χ h1i Z h2i Z
A
Janc-or-selfK
χ
def
= µZ.χ h1i µY.Z h2i Y
A
JfollowingK
χ
def
= A
Jdesc-or-selfK
η
1
A
JprecedingK
χ
def
= A
Jdesc-or-selfK
η
2
η
1
def
= A
Jfoll-siblingK
A
Janc-or-selfK
χ
η
2
def
= A
Jprec-siblingK
A
Janc-or-selfK
χ
Figure 5. Translation of XPath Axes.
E
J·K
·
: L
XPath
L
µ
L
µ
E
J/pK
χ
def
= P
JpK
((
µZ.¬
h
1
i
>∨
h
2
i
Z
)
(µYs∨h1iY ∨h2iY )
)
E
JpK
χ
def
= P
JpK
(χs)
E
Je
1
p e
2
K
χ
def
= E
Je
1
K
χ
E
Je
2
K
χ
E
Je
1
e
2
K
χ
def
= E
Je
1
K
χ
E
Je
2
K
χ
P
J·K
·
: Path L
µ
L
µ
P
Jp
1
/p
2
K
χ
def
= P
Jp
2
K
(
P
Jp
1
K
χ
)
P
Jp[q]K
χ
def
= P
JpK
χ
Q
JqK
>
P
Ja::σK
χ
def
= σ A
JaK
χ
P
Ja::K
χ
def
= A
JaK
χ
Figure 6. Translation of Expressions and Paths.
by going once upward via 1. From the remaining children, the con-
text is reached by going upward (any number of times) via 2 and
then finally once via 1.
Logical Interpretation of Expressions Fig. 6 gives the translation
of XPath expressions into L
µ
. The translation function E
JeK
χ
takes an XPath expression e and a L
µ
formula χ as input, and re-
turns the corresponding L
µ
translation. The translation of a relative
XPath expression marks the initial context with s. The translation
of an absolute XPath expression navigates to the root which is taken
as the initial context.
Figure 7 illustrates the translation of the XPath expression
“child::a[child::b]”. This expression selects all a child nodes of a
given context which have at least one b child. The translated L
µ
formula holds for a nodes which are selected by the expression.
The first part of the translated formula, ϕ, corresponds to the step

Citations
More filters
Book ChapterDOI

Automating Separation Logic with Trees and Data

TL;DR: A fragment of classical first-order logic for local reasoning about tree-like data structures is presented and implemented and integrated into an SL-based verification tool, successfully used to verify functional correctness of tree-based data structure implementations.
Proceedings ArticleDOI

Semantic subtyping with an SMT solver

TL;DR: A novel type-checking algorithm able to eliminate many dynamic tests and to detect many errors statically is presented, to rely on an SMT solver to compute subtyping efficiently.
Journal ArticleDOI

Set-theoretic foundation of parametric polymorphism and subtyping

TL;DR: The notion of "convexity" on which the solution is built up is introduced and its connections with parametricity as defined by Reynolds are discussed to whose study the work sheds new light.
Book ChapterDOI

SPARQL query containment under RDFS entailment regime

TL;DR: The problem of SPARQL query containment is encoded into an expressive logic called μ-calculus: where RDF graphs become transition systems, queries and schema axioms become formulas, and the containment problem is reduced to formula satisfiability test.
Journal ArticleDOI

Reasoning about XML with temporal logics and automata

TL;DR: It is shown that problems arising in static analysis of XML specifications and transformations can be dealt with using techniques similar to those developed forstatic analysis of programs, and two applications are given: one deals with a classical XML problem of reasoning about navigation in the presence of schemas, and the other relates to verifying security properties of XML views.
References
More filters
Journal ArticleDOI

Graph-Based Algorithms for Boolean Function Manipulation

TL;DR: In this paper, the authors present a data structure for representing Boolean functions and an associated set of manipulation algorithms, which have time complexity proportional to the sizes of the graphs being operated on, and hence are quite efficient as long as the graphs do not grow too large.

Model checking

TL;DR: Model checking tools, created by both academic and industrial teams, have resulted in an entirely novel approach to verification and test case generation that often enables engineers in the electronics industry to design complex systems with considerable assurance regarding the correctness of their initial designs.
Book ChapterDOI

Design and Synthesis of Synchronization Skeletons Using Branching-Time Temporal Logic

TL;DR: It is shown that it is possible to automatically synthesize the synchronization skeleton of a concurrent program from a Temporal Logic specification and it is believed that this approach may in the long run turn out to be quite practical.
Journal ArticleDOI

Results on the propositional μ-calculus

TL;DR: A propositional μ-calculus L μ is defined and study, which consists essentially of propositional modal logic with a least fixpoint operator that is syntactically simpler yet strictly more expressive than Propositional Dynamic Logic (PDL).

XML Path Language (XPath) Version 1.0

TL;DR: XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer, and has been endorsed by the Director as a W3C Recommendation.
Related Papers (5)
Frequently Asked Questions (18)
Q1. What is the known complexity for the resulting logic?

The best known complexity for the resulting logic is obtained through reduction to the emptiness problem of alternating tree automaton which is in 2O(n4·log n), where n corresponds to the length of a formula [18]. 

The authors present an algorithm to solve XPath decision problems under regular tree type constraints and show its use to statically typecheck XPath queries. To this end, the authors prove the decidability of a logic with converse for finite ordered trees whose time complexity is a simple exponential of the size of a formula. Building on these results, the authors describe a practical, effective system for solving the satisfiability of a formula. 

Finally, there are a number of interesting directions for further research that build on ideas developed here: extending XPath to restricted data values comparisons that preserves this complexity, for instance data values on a finite domain, and integrating related work on counting [ 8 ] to their logic. The authors also plan on continuing to improve the performance of their implementation. 

specifically the weak monadic second-order logic of two successors (WS2S) [9], is one of the most expressive decidable logic used when both regular types and queries [2] are under consideration. 

As the tree and the number of subformulas are finite, the satisfaction derivation is finite hence only a finite number of unfolding is necessary to prove that the tree satisfies the formula, which is what the lemma states. 

The essence of their results lives in a sub-logic of the alternation free modal µ-calculus (AFMC) with converse, some syntactic restrictions on formulas, without greatest fixpoint, and whose models are finite trees. 

To preserve semantics, the translation of p[q] stops the “selecting navigation” to those nodes reached by p, then filters them depending on whether q holds or not. 

Given a tree, if a formula ϕ is cycle free, then every node of the tree will be tested a finite number of time against any given subformula of ϕ. 

The main result of their paper is a sound and complete algorithm for the satisfiability of decision problems involving regular tree types and XPath queries with a tighter 2O(n) complexity in the length of a formula. 

5. The translation function, noted “A→JaKχ”, takes an XPath axis a as input, and returns its Lµ translation, parameterized by the Lµ formula χ given as parameter. 

The following hold for an XPath expression e and a Lµ formula ϕ denoting a set of focused trees, with ψ = E→JeKϕ:1. JψK∅ = SeJeKJϕK∅ 2. ψ is cycle-free 3. the size of ψ is linear in the size of e and ϕSeveral formalisms exist for describing types of XML documents (e.g. DTD, XML Schema, Relax NG). 

The algorithm proceeds in a bottom-up approach, repeatedly adding new triples until a satisfying model is found (i.e. a triple whose first component is a type implying the formula), or until nomore triple can be added. 

To check a formula ϕ, their algorithm builds satisfiable formulas out of some subformulas (and their negation) of ϕ, then checks whether ϕ was produced. 

there are a number of interesting directions for further research that build on ideas developed here: extending XPath to restricted data values comparisons that preserves this complexity, for instance data values on a finite domain, and integrating related work on counting [8] to their logic. 

For the XHTML case, the authors observe that the time needed is more important, but it remains practically relevant, especially for static analysis operations performed only at compile-time. 

Previous works [28, 3] showed that including general comparisons of data values from an infinite domain may lead to undecidability. 

The tests use XPath expressions shown on Fig. 12 (where “//” is used as a shorthand for “/desc-or-self::*/”) and XML types shown on Table 1. 

The approach only deals with emptiness of XPathexpressions without reverse axes, whereas their approach solves the more general problem of containment, including reverse axes.