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.

[1]  Scott Boag,et al.  XQuery 1.0 : An XML Query Language , 2007 .

[2]  Sebastian Maneth,et al.  XML Type Checking for Macro Tree Transducers with Holes , 2008, PLAN-X.

[3]  Alain Frisch,et al.  Towards Practical Typechecking for Macro Tree Transducers , 2007, DBPL.

[4]  Frank Neven,et al.  Frontiers of tractability for typechecking simple XML transformations , 2004, PODS.

[5]  Robert Giegerich,et al.  Composition and evaluation of attribute coupled grammars , 1988, Acta Informatica.

[6]  Dan Suciu,et al.  Typechecking for XML transformers , 2000, J. Comput. Syst. Sci..

[7]  Joost Engelfriet,et al.  Macro Tree Transducers , 1985, J. Comput. Syst. Sci..

[8]  Zoltán Fülöp,et al.  Syntax-Directed Semantics: Formal Models Based on Tree Transducers , 2011 .

[9]  Igor Walukiewicz,et al.  Unranked Tree Algebra , 2005 .

[10]  Michael J. Fischer,et al.  Grammars with Macro-Like Productions , 1968, SWAT.

[11]  Frank Neven,et al.  Automata theory for XML researchers , 2002, SGMD.

[12]  Helmut Seidl,et al.  Macro forest transducers , 2004, Inf. Process. Lett..

[13]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[14]  Joost Engelfriet,et al.  A comparison of pebble tree transducers with macro tree transducers , 2003, Acta Informatica.

[15]  Joost Engelfriet,et al.  Decidability of the Finiteness of Ranges of Tree Transductions , 1998, Inf. Comput..

[16]  Helmut Seidl,et al.  XML type checking with macro tree transducers , 2005, PODS.

[17]  Joost Engelfriet,et al.  Macro Tree Translations of Linear Size Increase are MSO Definable , 2003, SIAM J. Comput..

[18]  Miklós Bartha An algebraic definition of attributed transformations , 1982, Acta Cybern..

[19]  C. M. Sperberg-McQueen,et al.  eXtensible Markup Language (XML) 1.0 (Second Edition) , 2000 .

[20]  Alain Frisch Regular Tree Language Recognition with Static Information , 2004, IFIP TCS.

[21]  Christian Kirkegaard,et al.  Static analysis of XML transformations in Java , 2003, IEEE Transactions on Software Engineering.

[22]  Paul J. Walmsley,et al.  XML Schema Part 0: Primer Second Edition , 2004 .

[23]  Murali Mani,et al.  Taxonomy of XML schema languages using formal language theory , 2005, TOIT.

[24]  J. Virágh Deterministic ascending tree automata II , 1983, Acta Cybern..

[25]  Giora Slutzki,et al.  Alternating Tree Automata , 1983, Theor. Comput. Sci..

[26]  Bruno Courcelle,et al.  A Representation of Trees by Languages II , 1978, Theor. Comput. Sci..

[27]  Giora Slutzki,et al.  Parallel and Two-Way Automata on Directed Ordered Acyclic Graphs , 1981, Inf. Control..

[28]  Joost Engelfriet,et al.  Tree transducers, L systems and two-way machines (Extended Abstract) , 1978, J. Comput. Syst. Sci..

[29]  James W. Thatcher,et al.  Transformations and translations from the point of view of generalized finite automata theory , 1969, STOC.

[30]  Giuseppe Castagna,et al.  Parametric polymorphism for XML , 2005, POPL '05.

[31]  Benjamin C. Pierce,et al.  Regular expression pattern matching for XML , 2003, POPL '01.

[32]  S. Boag,et al.  XQuery 1.0 : An XML query language, W3C Working Draft 12 November 2003 , 2003 .

[33]  William C. Rounds,et al.  Mappings and grammars on trees , 1970, Mathematical systems theory.

[34]  Helmut Seidl,et al.  Exact XML Type Checking in Polynomial Time , 2007, ICDT.

[35]  Brenda S. Baker,et al.  Composition of Top-Down and Bottom-Up Tree Transductions , 1979, Inf. Control..

[36]  Anders Møller,et al.  The Design Space of Type Checkers for XML Transformation Languages , 2004, ICDT.

[37]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

[38]  Frank Neven,et al.  On the complexity of typechecking top-down XML transformations , 2005, Theor. Comput. Sci..

[39]  Frank Neven,et al.  Structured Document Transformations Based on XSL , 1999, DBPL.

[40]  Joost Engelfriet,et al.  The time complexity of typechecking tree-walking tree transducers , 2009, Acta Informatica.

[41]  Michael I. Schwartzbach,et al.  Static validation of XSL transformations , 2005, TOPL.

[42]  Hubert Comon,et al.  Tree automata techniques and applications , 1997 .

[43]  Alfred V. Aho,et al.  Translations on a Context-Free Grammar , 1971, Inf. Control..

[44]  Joost Engelfriet,et al.  Macro Tree Transducers, Attribute Grammars, and MSO Definable Tree Translations , 1999, Inf. Comput..

[45]  Ferenc Gécseg,et al.  Tree Languages , 1997, Handbook of Formal Languages.

[46]  Sheila A. Greibach,et al.  Hierarchy theorems for two-way finite state transducers , 1978, Acta Informatica.

[47]  Haim Gaifman,et al.  Decidable Optimization Problems for Database Logic Programs (Preliminary Report) , 1988, STOC 1988.

[48]  Joost Engelfriet,et al.  XML transformation by tree-walking transducers with invisible pebbles , 2007, PODS.

[49]  Benjamin C. Pierce,et al.  XDuce: A statically typed XML processing language , 2003, TOIT.