Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Constructively Characterizing Fold and Unfold

  • Conference paper
Logic Based Program Synthesis and Transformation (LOPSTR 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3018))

Abstract

In this paper we formally state and prove theorems characterizing when a function can be constructively reformulated using the recursion operators fold and unfold, i.e. given a function h, when can a function g be constructed such that h = fold g or h = unfold g? These results are refinements of the classical characterization of fold and unfold given by Gibbons, Hutton and Altenkirch in [6]. The proofs presented here have been formalized in Nuprl’s constructive type theory [5] and thereby yield program transformations which map a function h (accompanied by the evidence that h satisfies the required conditions), to a function g such that h = fold g or, as the case may be, h = unfold g.

This work was supported by NSF grant CCR-9985239, a DoD Multidisciplinary University Research Initiative (MURI) program administered by the Office of Naval Research under grant N00014-01-1-0765, and by the PhD program Logic in Computer Science of the German Research Foundation.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Allen, S.: NuprlPrimitives - Explanations of Nuprl Primitives and Conventions. Department of Computer Science, Cornell University, Ithaca, NY (2003), http://www.cs.cornell.edu/Info/People/sfa/Nuprl/NuprlPrimitives/

  2. Bird, R.S.: Functional algorithm design. In: Möller, B. (ed.) MPC 1995. LNCS, vol. 947, pp. 2–17. Springer, Heidelberg (1995)

    Google Scholar 

  3. Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. Journal of the ACM 24(1), 44–67 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  4. Caldwell, J.: Extracting recursion operators in Nuprl’s type-theory. In: Leuschel, M. (ed.) LOPSTR 2002. LNCS, vol. 2664, pp. 124–131. Springer, Heidelberg (2003)

    Google Scholar 

  5. Constable, R.L., Allen, S.F., Bromley, H.M., Cleaveland, W.R., Cremer, J.F., Harper, R.W., Howe, D.J., Knoblock, T.B., Mendler, N.P., Panangaden, P., Sasaki, J.T., Smith, S.F.: Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall, Englewood Cliffs (1986)

    Google Scholar 

  6. Gibbons, J., Hutton, G., Altenkirch, T.: When is a function a fold or an unfold? In: Corradini, A., Lenisa, M., Montanari, U. (eds.) Proceedings 4th Workshop on Coalgebraic Methods in Computer Science, CMCS 2001, Genova, Italy, April 6-7, vol. 44(1), Elsevier, Amsterdam (2001)

    Google Scholar 

  7. Gibbons, J., Jones, G.: The under-appreciated unfold. In: Proceedings 3rd ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 1998, Baltimore, MD, USA, September 26-29, vol. 34(1), pp. 273–279. ACM Press, New York (1998)

    Chapter  Google Scholar 

  8. Hutton, G.: Fold and unfold for program semantics. In: Proceedings 3rd ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 1998, Baltimore, MD, USA, September 26–29, vol. 34(1), pp. 280–288. ACM Press, New York (1998)

    Chapter  Google Scholar 

  9. Hutton, G.: A tutorial on the universality and expressiveness of fold. Journal of Functional Programming 9(4), 355–372 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  10. MacLane, S.: Categories for the Working Mathematician, 2nd edn. Graduate Texts in Mathematics, vol. 5. Springer, New York (1997) (1st ed., 1971)

    Google Scholar 

  11. Malcolm, G.: Algebraic data types and program transformation. Science of Computer Programming 14(2–3), 255–280 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  12. Martin-Löf, P.: Constructive mathematics and computer programming. In: Sixth International Congress for Logic, Methodology, and Philosophy of Science, pp. 153–175 (1982)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Wadler, P.: Deforestation: Transforming programs to eliminate trees. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, pp. 344–358. Springer, Heidelberg (1988)

    Google Scholar 

  15. Weber, T.: Program transformations in Nuprl. Master’s thesis, University of Wyoming, Laramie, WY (August 2002)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Weber, T., Caldwell, J. (2004). Constructively Characterizing Fold and Unfold. In: Bruynooghe, M. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2003. Lecture Notes in Computer Science, vol 3018. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-25938-1_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-25938-1_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22174-6

  • Online ISBN: 978-3-540-25938-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics