Type Checking of Tree Walking Transducers
نویسندگان
چکیده
Tree walking transducers are an expressive formalism for reasoning about XSLT-like document transformations. One of the useful properties of tree transducers is decidability of type checking: given a transducer and input and output types, it can be checked statically whether the transducer is type correct, i.e., whether each document adhering to the input type is necessarily transformed into documents adhering to the output type. Here, a “type” means a regular set of trees specified by a finite-state tree automaton. Usually, type checking of tree transducers is extremely expensive; already for simple top-down tree transducers it is known to be EXPTIME-complete. Are there expressive classes of tree transducers for which type checking can be performed in polynomial time? Most of the previous approaches are based on inverse type inference. The approach presented here goes the other direction: it uses forward type inference. This means to infer, given a transducer and an input type, the corresponding set of output trees. In general, this set is not a type, i.e., is not regular. However, its intersection emptiness with a given type can be decided. Using this approach it is shown that type checking can be performed in polynomial time, if (1) the output type is specified by a deterministic tree automaton and (2) the transducer visits every input node only a bounded number of times. If the tree walking transducer is additionally equipped with accumulating call-by-value parameters, then the complexity of type checking also depends (exponentially) on the number of such parameters. For this case a fast approximative type checking algorithm is presented, based on context-free tree grammars. Finally, the approach is generalized from trees to forest walking transducers which additionally support concatenation as a built-in output operation.
منابع مشابه
On normalization and type checking for tree transducers
Tree transducers are an expressive formalism for reasoning about tree structured data. Practical applications range from XSLT-like document transformations to translations of natural languages. Important problems for transducers are to decide whether two transducers are equivalent, to construct normal forms, give semantic characterizations, and type checking, i.e., to check whether the produced...
متن کاملThe complexity of typechecking tree-walking tree transducers?
Tree-walking tree transducers can be typechecked in double exponential time. More generally, compositions of k tree-walking tree transducers can be typechecked in (k + 1)-fold exponential time.
متن کاملDomains of Partial Attributed Tree Transducers Domains of Partial Attributed Tree Transducers
The domains of partial attributed tree transducers (patt's) are the tree languages recognized by tree walking automata in universal acceptance mode. Moreover, the domains of patt's having monadic output are the tree languages recognized by deter-ministic tree walking automata.
متن کاملDomains of partial attributed tree transducers
The domains of partial attributed tree transducers (patt’s) are the tree languages recognized by tree walking automata in universal acceptance mode. Moreover, the domains of patt’s having monadic output are the tree languages recognized by deterministic tree walking automata. 2000 Elsevier Science B.V. All rights reserved.
متن کاملXML Type Checking for Macro Tree Transducers with Holes
Macro forest transducers (mfts) extend macro tree transducers (mtts) from ranked to unranked trees. Mfts are more powerful than mtts (operating on binary tree encodings) because they support sequence concatenation of output trees as build-in operation. Surprisingly, inverse type inference for mfts, for a fixed output type, can be done within the same complexity as for mtts. Inverse type inferen...
متن کامل