5 research outputs found
Linear Bounded Composition of Tree-Walking Tree Transducers: Linear Size Increase and Complexity
Compositions of tree-walking tree transducers form a hierarchy with respect
to the number of transducers in the composition. As main technical result it is
proved that any such composition can be realized as a linear bounded
composition, which means that the sizes of the intermediate results can be
chosen to be at most linear in the size of the output tree. This has
consequences for the expressiveness and complexity of the translations in the
hierarchy. First, if the computed translation is a function of linear size
increase, i.e., the size of the output tree is at most linear in the size of
the input tree, then it can be realized by just one, deterministic,
tree-walking tree transducer. For compositions of deterministic transducers it
is decidable whether or not the translation is of linear size increase. Second,
every composition of deterministic transducers can be computed in deterministic
linear time on a RAM and in deterministic linear space on a Turing machine,
measured in the sum of the sizes of the input and output tree. Similarly, every
composition of nondeterministic transducers can be computed in simultaneous
polynomial time and linear space on a nondeterministic Turing machine. Their
output tree languages are deterministic context-sensitive, i.e., can be
recognized in deterministic linear space on a Turing machine. The membership
problem for compositions of nondeterministic translations is nondeterministic
polynomial time and deterministic linear space. The membership problem for the
composition of a nondeterministic and a deterministic tree-walking tree
translation (for a nondeterministic IO macro tree translation) is log-space
reducible to a context-free language, whereas the membership problem for the
composition of a deterministic and a nondeterministic tree-walking tree
translation (for a nondeterministic OI macro tree translation) is possibly
NP-complete
XQTC: A Static Type-Checker for XQuery Using Backward Type Inference
We present a novel technique and a tool for static type-checking of XQuery programs. The tool looks for errors in the program by jointly analyzing the source code of the program, input and output schemas that respectively describe the sets of documents admissible as input and as output of the program. The crux and the novelty of our results reside in the joint use of backward type inference and a two-way logic to represent inferred tree type portions. This allowed us to design and implement a type-checker for XQuery which is more precise and supports a larger XQuery fragment compared to the approaches previously proposed in the literature; in particular compared to the only few actually implemented static type-checkers such as the one in Galax. The whole system uses compilers and a satisfiability solver for deciding containment for two-way regular tree expressions. Our tool takes an XQuery program and two schemas Sin and Sout as input. If the program is found incorrect, then it automatically generates a counter-example valid w.r.t. Sin and such that the program produces an invalid output w.r.t Sout. This counter-example can be used by the programmer to fix the program.Nous preĢsentons une technique nouvelle et un outil pour le controĢle de type statique des programmes XQuery. L'outil recherche les erreurs dans le programme en analysant aĢ la fois le code source du programme et les scheĢmas d'entreĢe et de sortie qui deĢcrivent respectivement les ensembles de documents admissibles en entreĢe et en sortie. L'originaliteĢ de nos reĢsultats reĢside dans l'utilisation conjointe de l'infeĢrence de type arrieĢre et d'une logique avec programmes inverses pour repreĢsenter des fragments de types d'arbre. Cela nous a permis de concevoir et de reĢaliser un controĢleur de type pour XQuery qui est plus preĢcis et supporte un fragment de XQuery plus large que les approches proposeĢes preĢceĢdemment dans la litteĢrature, en particulier si on se reĢfeĢre aux quelques controĢleurs de type statiques effectivement reĢaliseĢs, tel que celui de Galax. L'ensemble du systeĢme utilise des compilateurs et un solveur pour deĢcider de l'inclusion des expressions d'arbres reĢgulieĢres bi-directionnelles. Notre outil prend en entreĢe un programme XQuery et deux scheĢmas Sin et Sout. Si le programme est reconnu incorrect, l'outil engendre automatiquement un contre-exemple valide vis-aĢ-vis de Sin et tel que le programme produise un reĢsultat invalide vis-aĢ-vis de Sout. Ce contre-exemple peut alors eĢtre utiliseĢ par le programmeur pour corriger son programme