Skip to main content

Implementing Circularity Using Partial Evaluation

  • Conference paper
  • First Online:
Programs as Data Objects (PADO 2001)

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

Included in the following conference series:

Abstract

Complex data dependencies can often be expressed concisely by defining a variable in terms of part of its own value. Such a circular reference can be naturally expressed in a lazy functional language or in an attribute grammar. In this paper, we consider circular references in the context of an imperative C-like language, by extending the language with a new construct, persistent variables. We show that an extension of partial evaluation can eliminate persistent variables, producing a staged C program. This approach has been implemented in the Tempo specializer for C programs, and has proven useful in the implementation of run-time specialization.

Article

This research was partially supported by the Danish Natural Science Research Council (PLT project).

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

Access this chapter

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.

References

  1. A.W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998. pages 131–132, 138-139.

    Google Scholar 

  2. G.J. Barzdins and M.A. Bulyonkov. Mixed computation and translation: Linearisation and decomposition of compilers. Preprint 791 from Computing Centre of Sibirian division of USSR Academy of Sciences, p.32, Novosibirsk, 1988.

    Google Scholar 

  3. R.S. Bird. Using circular programs to eliminate multiple traversals of data. Acta Informatica, 21:239–250, 1984/85.

    Article  MATH  Google Scholar 

  4. A. Bondorf and O. Danvy. Automatic autoprojection of recursive equations with global variables and abstract data types. Science of Computer Programming, 16:151–195, 1991.

    Article  MATH  Google Scholar 

  5. S. Chirokoff, C. Consel, and R. Marlet. Combining program and data specialization. Higher-Order and Symbolic Computation, 12(4):309–335, December 1999.

    Article  MATH  Google Scholar 

  6. C. Consel, L. Hornof, F. Noël, J. Noyé, and E.N. Volanschi. A uniform approach for compile-time and run-time specialization. In O. Danvy, R. Glück, and P. Thiemann, editors, Partial Evaluation, International Seminar, Dagstuhl Castle, number 1110 in Lecture Notes in Computer Science, pages 54–72, February 1996.

    Google Scholar 

  7. R. Glück and J. Jørgensen. An automatic program generator for multi-level specialization. Lisp and Symbolic Computation, 10:113–158, 1997.

    Article  Google Scholar 

  8. L. Hornof and J. Noyé. Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. Theoretical Computer Science, 248(1-2):3–27, 2000.

    Article  MATH  Google Scholar 

  9. L. Hornof, J. Noyé, and C. Consel. Effective specialization of realistic programs via use sensitivity. In P. Van Hentenryck, editor, Proceedings of the Fourth International Symposium on Static Analysis, SAS’97, volume 1302 of Lecture Notes in Computer Science, pages 293–314, Paris, France, September 1997. Springer-Verlag.

    Google Scholar 

  10. T. Johnsson. Attribute grammars as a functional programming paradigm. In G. Kahn, editor, 1987 Conference on Functional Programming Languages and Computer Architecture, volume 274 of Lecture Notes in Computer Science, pages 154–173, Portland, OR, September 1987. Springer-Verlag.

    Google Scholar 

  11. N.D. Jones, C. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. International Series in Computer Science. Prentice-Hall, June 1993.

    MATH  Google Scholar 

  12. J. Karczmarczuk. Calcul des adjoints et programmation paresseuse. In Journées Francophones des Langages Applicatifs (JFLA’ 2001), Metabief, France, January 2001.

    Google Scholar 

  13. U. Kastens. Ordered attributed grammars. Acta Informatica, 13:229–256, 1980.

    Article  MATH  MathSciNet  Google Scholar 

  14. T.B. Knoblock and E. Ruf. Data specialization. In Proceedings of the ACM SIGPLAN’ 96 Conference on Programming Language Design and Implementation, pages 215–225, Philadelphia, PA, May 1996. ACM SIGPLAN Notices, 31(5). Also TR MSR-TR-96-04, Microsoft Research, February 1996.

    Google Scholar 

  15. J. Lawall and G. Muller. Faster run-time specialized code using data specialization. Research Report 3833, INRIA, Rennes, France, December 1999.

    Google Scholar 

  16. K. Malmkjær. Program and data specialization: Principles, applications, and self-application. Master’s thesis, DIKU University of Copenhagen, August 1989.

    Google Scholar 

  17. R. Marlet, C. Consel, and P. Boinot. Efficient incremental run-time specialization for free. In Proceedings of the ACM SIGPLAN’ 99 Conference on Programming Language Design and Implementation (PLDI’99), pages 281–292, Atlanta, GA, May 1999.

    Google Scholar 

  18. M. Pennings. Generating incremental attribute evaluators. PhD thesis, Department of Computer Science, Utrecht University, The Netherlands, November 1994.

    Google Scholar 

  19. J. Saraiva. Purely Functional Implementation of Attribute Grammars. PhD thesis, Department of Computer Science, Utrecht University, The Netherlands, December 1999.

    Google Scholar 

  20. J. Saraiva, D. Swierstra, and M. Kuiper. Strictification of computations on trees. In 3th Latin-American Conference on Functional Programming (CLaPF’99), March 1999.

    Google Scholar 

  21. J. Saraiva, D. Swierstra, and M. Kuiper. Functional incremental attribute evaluation. In D.A. Watt, editor, 9th International Conference on Compiler Construction, volume 1781 of Lecture Notes in Computer Science, pages 279–294, Berlin, Germany, March 2000. Springer-Verlag.

    Chapter  Google Scholar 

  22. J. Saraiva, D. Swierstra, M. Kuiper, and M. Pennings. Strictification of lazy functions. Technical Report UU-CS 1996-51, Utrecht University, 1996.

    Google Scholar 

  23. E. Sumii and N. Kobayashi. Online-and-offline partial evaluation: A mixed approach (extended abstract). In 2000 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’ 00), pages 12–21. ACM Press, 2000. Also available as SIGPLAN Notices 34(11).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lawall, J.L. (2001). Implementing Circularity Using Partial Evaluation. In: Danvy, O., Filinski, A. (eds) Programs as Data Objects. PADO 2001. Lecture Notes in Computer Science, vol 2053. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44978-7_6

Download citation

  • DOI: https://doi.org/10.1007/3-540-44978-7_6

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42068-2

  • Online ISBN: 978-3-540-44978-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics