5 research outputs found

    Linear Bounded Composition of Tree-Walking Tree Transducers: Linear Size Increase and Complexity

    Get PDF
    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

    Get PDF
    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
    corecore