Skip to main content

Hygienic Macros for ACL2

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6546))

Abstract

ACL2 is a theorem prover for a purely functional subset of Common Lisp. It inherits Common Lisp’s unhygienic macros, which are used pervasively to eliminate repeated syntactic patterns. The lack of hygiene means that macros do not automatically protect their producers or consumers from accidental variable capture. This paper demonstrates how this lack of hygiene interferes with theorem proving. It then explains how to design and implement a hygienic macro system for ACL2. An evaluation of the ACL2 code base shows the potential impact of this hygienic macro system on existing libraries and practices.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   69.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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Kaufmann, M., Manolios, P., Moore, J.S.: Computer-Aided Reasoning: an Approach. Kluwer Academic Publishers, Dordrecht (2000)

    Google Scholar 

  2. Kaufmann, M., Moore, J.S.: Design goals of ACL2. Technical report, Computational Logic, Inc. (1994)

    Google Scholar 

  3. Kohlbecker, E., Friedman, D.P., Felleisen, M., Duba, B.: Hygienic macro expansion. In: Proc. 1986 ACM Conference on LISP and Functional Programming, pp. 151–161. ACM Press, New York (1986)

    Chapter  Google Scholar 

  4. Clinger, W., Rees, J.: Macros that work. In: Proc. 18th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 155–162. ACM Press, New York (1991)

    Google Scholar 

  5. Dybvig, R.K., Hieb, R., Bruggeman, C.: Syntactic abstraction in Scheme. Lisp and Symbolic Computation 5(4), 295–326 (1992)

    Article  Google Scholar 

  6. Herman, D., Wand, M.: A theory of hygienic macros. In: Gairing, M. (ed.) ESOP 2008. LNCS, vol. 4960, pp. 48–62. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  7. Flatt, M.: Composable and compilable macros: you want it when? In: Proc. 7th ACM SIGPLAN International Conference on Functional Programming, pp. 72–83. ACM Press, New York (2002)

    Google Scholar 

  8. Kaufmann, M., Moore, J.S.: ACL2 Documentation (2009), http://userweb.cs.utexas.edu/users/moore/acl2/current/acl2-doc.html

  9. Owre, S., Shankar, N., Rushby, J.M., Stringer-Calvert, D.W.J.: PVS Language Reference (2001), http://pvs.csl.sri.com/doc/pvs-language-reference.pdf

  10. Danielsson, N.A., Norell, U.: Parsing mixfix operators. In: Proc. 20th International Symposium on the Implementation and Application of Functional Languages, School of Computer Science of the University of Hertfordshire (2008)

    Google Scholar 

  11. Wenzel, M.: The Isabelle/Isar Reference Manual (2010), http://isabelle.in.tum.de/dist/Isabelle/doc/isar-ref.pdf

  12. Griffin, T.G.: Notational definition—a formal account. In: Proc. 3rd Annual Symposium on Logic in Computer Science, pp. 372–383. IEEE Press, Los Alamitos (1988)

    Google Scholar 

  13. The Coq Development Team: The Coq Proof Assistant Reference Manual (2009), http://coq.inria.fr/coq/distrib/current/refman/

  14. Kelsey, R., Clinger, W., Rees, J. (eds.): Revised5 report on the algorithmic language Scheme. ACM SIGPLAN Notices 33(9), 26–76 (1998)

    Article  Google Scholar 

  15. Gray, K., Flatt, M.: Compiling Java to PLT Scheme. In: Proc. 5th Workshop on Scheme and Functional Programming, pp. 53–61 (2004)

    Google Scholar 

  16. Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of Typed Scheme. In: Proc. 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 395–406. ACM Press, New York (2008)

    Chapter  Google Scholar 

  17. Vaillancourt, D., Page, R., Felleisen, M.: ACL2 in DrScheme. In: Proc. 6th International Workshop on the ACL2 Theorem Prover and its Applications, pp. 107–116 (2006)

    Google Scholar 

  18. Culpepper, R.: Refining Syntactic Sugar: Tools for Supporting Macro Development. PhD dissertation, Northeastern University (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Eastlund, C., Felleisen, M. (2011). Hygienic Macros for ACL2. In: Page, R., Horváth, Z., Zsók, V. (eds) Trends in Functional Programming. TFP 2010. Lecture Notes in Computer Science, vol 6546. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22941-1_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22941-1_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22940-4

  • Online ISBN: 978-3-642-22941-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics