Stacking Cycles: Functional Transformation of Circular Data

  • Baltasar Trancón y Widemann
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2670)


Functional programming is very powerful when applied to tree-shaped data. Real-world software problems often involve circular graph-shaped data. In this paper, we characterize a class of functions on circular data graphs extending the class of primitively corecursive functions. We propose an abstract, effective implementation technique for these functions under an eager evaluation strategy on standard stack machines. The proposed implementation ensures termination and can be tuned either for exactness or for speed. The latter variant is asymptotically as efficient as standard implementations of algebraic recursion, at the price of suboptimal homomorphic result graphs with decently bounded redundancy.


Coalgebra corecursion anamorphism code generation cycle detection function memoization 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. ASU86.
    A.V. Aho, R. Sethi, and J.D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986.Google Scholar
  2. Bir80.
    R.S. Bird. Tabulation Techniques for Recursive Programs. ACM Comp. Surv., 12(4):403–417, 1980.zbMATHCrossRefMathSciNetGoogle Scholar
  3. Bro85.
    D.R. Brownbridge. Cyclic reference counting for combinator machines. In LNCS, volume 201. Springer, 1985.Google Scholar
  4. CF92.
    R. Cockett and T. Fukushima. About Charity. Technical Report 92/480/18, University of Calgary, 1992.Google Scholar
  5. Erw01.
    M. Erwig. Inductive graphs and functional graph algorithms, 2001.Google Scholar
  6. JL96.
    R. Jones and R. Lins. Garbage Collection. Wiley, Chichester, 1996.zbMATHGoogle Scholar
  7. MFP91.
    E. Meijer, M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Proceedings of the ACM FPCA’91, LNCS, volume 523. Springer, 1991.Google Scholar
  8. Mic68.
    D. Michie. “Memo” functions and machine learning. Nature, 218:19–22, 1968.CrossRefGoogle Scholar
  9. Pep91.
    P. Pepper. The Programming Language OPAL (5th corrected edition). Technical Report 91-10, TU Berlin, June 1991.Google Scholar
  10. PvEP88.
    E.J.H. Pepels, M.C.J.D. van Eekelen, and M.J. Plasmeijer. A cyclic reference counting algorithm and its proof. Technical Report 88-10, Computing Science Department, University of Nijmegen, 1988.Google Scholar
  11. Rut96.
    J.J.M.M. Rutten. Universal Coalgebra: a Theory of Systems, Technical Report CS-R9652. CWI, Amsterdam, 1996.Google Scholar
  12. Sal87.
    J.D. Salkild. Implementation and analysis of two reference counting algorithms. Master’s thesis, University College, London, 1987.Google Scholar
  13. TT97.
    A. Telford and D. Turner. Ensuring streams flow. In Algebraic Methodology and Software Technology, pages 509–523, 1997.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Baltasar Trancón y Widemann
    • 1
  1. 1.Department of Computer ScienceTechnische Universität BerlinGermany

Personalised recommendations