Towards Practical Typechecking for Macro Tree Transducers

  • Alain Frisch
  • Haruo Hosoya
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4797)


Macro tree transducers (mtt) are an important model that both covers many useful XML transformations and allows decidable exact typechecking. This paper reports our first step toward an implementation of mtt typechecker that has a practical efficiency. Our approach is to represent an input type obtained from a backward inference as an alternating tree automaton, in a style similar to Tozawa’s XSLT0 typechecking. In this approach, typechecking reduces to checking emptiness of an alternating tree automaton. We propose several optimizations (Cartesian factorization, state partitioning) on the backward inference process in order to produce much smaller alternating tree automata than the naive algorithm, and we present our efficient algorithm for checking emptiness of alternating tree automata, where we exploit the explicit representation of alternation for local optimizations. Our preliminary experiments confirm that our algorithm has a practical performance that can typecheck simple transformations with respect to the full XHTML in a reasonable time.


Equivalence Relation Output Type Type Inference Input Tree Tree Automaton 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Alon, N., Milo, T., Neven, F., Suciu, D., Vianu, V.: XML with data values: Typechecking revisited. In: Proceedings of Symposium on Principles of Database Systems (PODS) (2001)Google Scholar
  2. 2.
    Appel, A.W., MacQueen, D.B.: Standard ML of New Jersey. In: Third Int’l. Symp. on Prog. Lang. Implementation and Logic Programming, pp. 1–13. Springer, Heidelberg (1991)Google Scholar
  3. 3.
    Benzaken, V., Castagna, G., Frisch, A.: CDuce: An XML-centric general-purpose language. In: Proceedings of the International Conference on Functional Programming (ICFP), pp. 51–63 (2003)Google Scholar
  4. 4.
    Engelfriet, J., Filé, G.: The formal power of one-visit attribute grammars. Acta Informatica 16, 275–302 (1981)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Engelfriet, J., Maneth, S.: A comparison of pebble tree transducers with macro tree transducers. Acta Informatica 39(9), 613–698 (2003)zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Engelfriet, J., Vogler, H.: Macro tree transducers. J. Comput. Syst. Sci. 31(1), 146–710 (1985)MathSciNetGoogle Scholar
  7. 7.
    Frisch, A.: Théorie, conception et réalisation d’un langage de programmation adapté à XML. PhD thesis, Universit Paris 7 (2004)Google Scholar
  8. 8.
    Frisch, A., Hosoya, H.: Towards practial typechecking for macro tree transducers. Technical report, INRIA (2007)Google Scholar
  9. 9.
    Hosoya, H.: Regular expression filters for XML. Journal of Functional Programming 16(6), 711–750 (2006), Short version appeared in Proceedings of Programming Technologies for XML (PLAN-X), pp. 13–27 (2004)Google Scholar
  10. 10.
    Hosoya, H., Pierce, B.C.: XDuce: A typed XML processing language. ACM Transactions on Internet Technology 3(2), 117–148 (2003). In: Suciu, D., Vossen, G. (eds.) WebDB 2000. LNCS, vol. 1997, pp. 226–244. Springer, Heidelberg (2001)Google Scholar
  11. 11.
    Hosoya, H., Vouillon, J., Pierce, B.C.: Regular expression types for XML. ACM Transactions on Programming Languages and Systems, 27(1), 46–90 (2004). Short version appeared in Proceedings of the International Conference on Functional Programming (ICFP), pp. 11–22 (2000)Google Scholar
  12. 12.
    Leroy, X., Doligez, D., Garrigue, J., Vouillon, J., Rémy, D.: The Objective Caml system. Software and documentation available on the Web (1996),
  13. 13.
    Maneth, S., Perst, T., Berlea, A., Seidl, H.: XML type checking with macro tree transducers. In: Proceedings of Symposium on Principles of Database Systems (PODS), pp. 283–294 (2005)Google Scholar
  14. 14.
    Maneth, S., Perst, T., Seidl, H.: Exact XML type checking in polynomial time. In: Schwentick, T., Suciu, D. (eds.) ICDT 2007. LNCS, vol. 4353, pp. 254–268. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  15. 15.
    Martens, W., Neven, F.: Typechecking top-down uniform unranked tree transducers. In: Proceedings of International Conference on Database Theory, pp. 64–78 (2003)Google Scholar
  16. 16.
    Martens, W., Neven, F.: Frontiers of tractability for typechecking simple XML transformations. In: Proceedings of Symposium on Principles of Database Systems (PODS), pp. 23–34 (2004)Google Scholar
  17. 17.
    Milo, T., Suciu, D.: Type inference for queries on semistructured data. In: Proceedings of Symposium on Principles of Database Systems, Philadelphia, pp. 215–226 (May 1999)Google Scholar
  18. 18.
    Milo, T., Suciu, D., Vianu, V.: Typechecking for XML transformers. In: Proceedings of the Nineteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pp. 11–22. ACM, New York (2000)Google Scholar
  19. 19.
    Møller, A., Olesen, M.Ø., Schwartzbach, M.I.: Static validation of XSL Transformations. Technical Report RS-05-32, BRICS, Draft, accepted for TOPLAS (October 2005)Google Scholar
  20. 20.
    Murata, M.: Transformation of documents and schemas by patterns and contextual conditions. In: Nicholas, C., Wood, D. (eds.) PODDP 1996 and PODP 1996. LNCS, vol. 1293, pp. 153–169. Springer, Heidelberg (1997)Google Scholar
  21. 21.
    Nakano, K., Mu, S.-C.: A pushdown machine for recursive XML processing. In: Kobayashi, N. (ed.) APLAS 2006. LNCS, vol. 4279, pp. 340–356. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  22. 22.
    Perst, T., Seidl, H.: Macro forest transducers. Information Processing Letters 89(3), 141–149 (2004)CrossRefMathSciNetGoogle Scholar
  23. 23.
    Slutzki, G.: Alternating tree automata. Theoretical Computer Science 41, 305–318 (1985)zbMATHCrossRefMathSciNetGoogle Scholar
  24. 24.
    Suda, T., Hosoya, H.: Non-backtracking top-down algorithm for checking tree automata containment. In: Farré, J., Litovsky, I., Schmitz, S. (eds.) CIAA 2005. LNCS, vol. 3845, pp. 83–92. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  25. 25.
    Tozawa, A.: Towards static type checking for XSLT. In: Proceedings of ACM Symposium on Document Engineering, ACM Press, New York (2001)Google Scholar
  26. 26.
    Tozawa, A.: XML type checking using high-level tree transducer. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 81–96. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  27. 27.
    Tozawa, A., Hagiya, M.: XML schema containment checking based on semi-implicit techniques. In: Ibarra, O.H., Dang, Z. (eds.) CIAA 2003. LNCS, vol. 2759, pp. 213–225. Springer, Heidelberg (2003)Google Scholar
  28. 28.
    Tozawa, A., Hagiya, M.: Efficient decision procedure for a logic for XML, 2004 (unpublished manuscipt)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Alain Frisch
    • 1
  • Haruo Hosoya
    • 2
  1. 1.INRIA Rocquencourt 
  2. 2.The University of Tokyo 

Personalised recommendations