Tree automata are traditionally used to study properties of tree languages and tree transformations. In this paper, we consider tree automata as the basis for modular and extensible recursion schemes. We show, using well-known techniques, how to derive from standard tree automata highly modular recursion schemes. Functions that are defined in terms of these recursion schemes can be combined, reused and transformed in many ways. This flexibility facilitates the specification of complex transformations in a concise manner, which is illustrated with a number of examples.


Function Symbol Successor State Tree Automaton Recursion Scheme Type Term 
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.
    Bahr, P., Hvitved, T.: Compositional Data Types. In: Proceedings of the Seventh ACM SIGPLAN Workshop on Generic Programming, WGP 2011, pp. 83–94. ACM, New York (2011)CrossRefGoogle Scholar
  2. 2.
    Bahr, P., Hvitved, T.: Compdata (2012), http://hackage.haskell.org/package/compdata, module Data.Comp.Automata
  3. 3.
    Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree automata techniques and applications (2007), http://www.grappa.univ-lille3.fr/tata (release October 12, 2007)
  4. 4.
    Day, L., Hutton, G.: Towards Modular Compilers For Effects. In: Proceedings of the Symposium on Trends in Functional Programming, Madrid, Spain (2011)Google Scholar
  5. 5.
    Eilenberg, S., Wright, J.B.: Automata in general algebras. Inform. Control. 11(4), 452–470 (1967)MathSciNetMATHCrossRefGoogle Scholar
  6. 6.
    Fokkinga, M.M.: Law and Order in Algorithmics. Ph.D. thesis, University of Twente, 7500 AE Enschede, Netherlands (1992)Google Scholar
  7. 7.
    Fülöp, Z., Vogler, H.: Syntax-Directed Semantics: Formal Models Based on Tree Transducers. Springer-Verlag New York, Inc. (1998)Google Scholar
  8. 8.
    Gibbons, J.: Upwards and Downwards Accumulations on Trees. In: Bird, R.S., Morgan, C.C., Woodcock, J.C.P. (eds.) MPC 1992. LNCS, vol. 669, pp. 122–138. Springer, Heidelberg (1993)CrossRefGoogle Scholar
  9. 9.
    Gibbons, J.: Polytypic Downwards Accumulations. In: Jeuring, J. (ed.) MPC 1998. LNCS, vol. 1422, pp. 207–233. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  10. 10.
    Gibbons, J.: Generic downwards accumulations. Sci. Comput. Program. 37(1-3), 37–65 (2000)MathSciNetMATHCrossRefGoogle Scholar
  11. 11.
    Hasuo, I., Jacobs, B., Yu, H.-J.: Categorical Views on Computations on Trees (Extended Abstract). In: Arge, L., Cachin, C., Jurdziński, T., Tarlecki, A. (eds.) ICALP 2007. LNCS, vol. 4596, pp. 619–630. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  12. 12.
    Hinze, R., Löh, A., Oliveira, B.C.d.S.: “Scrap Your Boilerplate” Reloaded. In: Hagiya, M. (ed.) FLOPS 2006. LNCS, vol. 3945, pp. 13–29. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  13. 13.
    Hinze, R., Löh, A.: “Scrap Your Boilerplate” Revolutions. In: Yu, H.-J. (ed.) MPC 2006. LNCS, vol. 4014, pp. 180–208. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  14. 14.
    Kiselyov, O., Lämmel, R., Schupke, K.: Strongly typed heterogeneous collections. In: Haskell 2004: Proceedings of the ACM SIGPLAN Workshop on Haskell, pp. 96–107. ACM Press (2004)Google Scholar
  15. 15.
    Knuth, D.E.: Semantics of context-free languages. Theory Comput. Syst. 2(2), 127–145 (1968)MathSciNetMATHGoogle Scholar
  16. 16.
    Kühnemann, A.: Benefits of Tree Transducers for Optimizing Functional Programs. In: Arvind, V., Sarukkai, S. (eds.) FST TCS 1998. LNCS, vol. 1530, pp. 146–158. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  17. 17.
    Lämmel, R., Jones, S.P.: Scrap your boilerplate with class: extensible generic functions. In: Proceedings of the Tenth ACM SIGPLAN International Conference on Functional Programming, pp. 204–215. ACM, New York (2005)CrossRefGoogle Scholar
  18. 18.
    Lewis, J.R., Launchbury, J., Meijer, E., Shields, M.B.: Implicit parameters: dynamic scoping with static types. In: Proceedings of the 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 108–118. ACM, New York (2000)CrossRefGoogle Scholar
  19. 19.
    Marlow, S.: Haskell 2010 Language Report (2010)Google Scholar
  20. 20.
    Meijer, E., Fokkinga, M., Paterson, R.: Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 124–144. Springer, Heidelberg (1991)CrossRefGoogle Scholar
  21. 21.
    Mitchell, N., Runciman, C.: Uniform boilerplate and list processing. In: Proceedings of the ACM SIGPLAN Workshop on Haskell, pp. 49–60. ACM, New York (2007)CrossRefGoogle Scholar
  22. 22.
    Paakki, J.: Attribute grammar paradigmsa high-level methodology in language implementation. ACM Comput. Surv. 27(2), 196–255 (1995)CrossRefGoogle Scholar
  23. 23.
    Swierstra, W.: Data types à la carte. J. Funct. Program. 18(4), 423–436 (2008)MathSciNetMATHCrossRefGoogle Scholar
  24. 24.
    Viera, M., Swierstra, S.D., Swierstra, W.: Attribute grammars fly first-class: how to do aspect oriented programming in Haskell. In: Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, pp. 245–256. ACM, New York (2009)CrossRefGoogle Scholar
  25. 25.
    Voigtländer, J.: Formal Efficiency Analysis for Tree Transducer Composition. Theory Comput. Syst. 41(4), 619–689 (2007)MathSciNetCrossRefGoogle Scholar
  26. 26.
    Wadler, P.: Deforestation: Transforming Programs to Eliminate Trees. Theor. Comput. Sci. 73(2), 231–248 (1990)MathSciNetMATHCrossRefGoogle Scholar
  27. 27.
    Yakushev, A.R., Holdermans, S., Löh, A., Jeuring, J.: Generic programming with fixed points for mutually recursive datatypes. In: Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, pp. 233–244. ACM, New York (2009)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Patrick Bahr
    • 1
  1. 1.Department of Computer ScienceUniversity of CopenhagenCopenhagenDenmark

Personalised recommendations