Skip to main content

Program Logics for Homogeneous Meta-programming

  • Conference paper
Logic for Programming, Artificial Intelligence, and Reasoning (LPAR 2010)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 6355))

  • 1221 Accesses

Abstract

A meta-program is a program that generates or manipulates another program; in homogeneous meta-programming, a program may generate new parts of, or manipulate, itself. Meta-programming has been used extensively since macros were introduced to Lisp, yet we have little idea how formally to reason about meta-programs. This paper provides the first program logics for homogeneous meta-programming – using a variant of MiniML\(_e^{\square}\) by Davies and Pfenning as underlying meta-programming language. We show the applicability of our approach by reasoning about example meta-programs from the literature. We also demonstrate that our logics are relatively complete in the sense of Cook, enable the inductive derivation of characteristic formulae, and exactly capture the observational properties induced by the operational semantics.

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

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. Berger, M.: Program Logics for Sequential Higher-Order Control. In: Arbab, F., Sirjani, M. (eds.) Fundamentals of Software Engineering. LNCS, vol. 5961, pp. 194–211. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  2. Berger, M., Honda, K., Yoshida, N.: A Logical Analysis of Aliasing in Imperative Higher-Order Functions. J. Funct. Program. 17(4-5), 473–546 (2007)

    MathSciNet  MATH  Google Scholar 

  3. Berger, M., Honda, K., Yoshida, N.: Completeness and logical full abstraction in modal logics for typed mobile processes. In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008, Part II. LNCS, vol. 5126, pp. 99–111. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  4. Berger, M., Tratt, L.: Program Logics for Homogeneous Metaprogramming. Long version of the present paper (to appear)

    Google Scholar 

  5. Cook, S.A.: Soundness and completeness of an axiom system for program verification. SIAM J. Comput. 7(1), 70–90 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  6. Davies, R., Pfenning, F.: A modal analysis of staged computation. J. ACM 48(3), 555–604 (2001)

    MathSciNet  MATH  Google Scholar 

  7. Fogarty, S., Pašalić, E., Siek, J., Taha, W.: Concoqtion: Indexed Types Now! In: Proc. PEPM, pp. 112–121 (2007)

    Google Scholar 

  8. Gunter, C.A.: Semantics of Programming Languages. MIT Press, Cambridge (1995)

    Google Scholar 

  9. Honda, K.: From Process Logic to Program Logic. In: ICFP 2004, pp. 163–174. ACM Press, New York (2004)

    Google Scholar 

  10. Honda, K., Berger, M., Yoshida, N.: Descriptive and Relative Completeness of Logics for Higher-Order Functions. In: Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4052, pp. 360–371. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  11. Honda, K., Yoshida, N.: A compositional logic for polymorphic higher-order functions. In: Proc. PPDP, pp. 191–202 (2004)

    Google Scholar 

  12. Honda, K., Yoshida, N., Berger, M.: An Observationally Complete Program Logic for Imperative Higher-Order Functions. In: LICS 2005, pp. 270–279 (2005)

    Google Scholar 

  13. Longley, J., Plotkin, G.: Logical Full Abstraction and PCF. In: Tbilisi Symposium on Logic, Language and Information, CSLI (1998)

    Google Scholar 

  14. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: Proc. LICS 2002, pp. 55–74 (2002)

    Google Scholar 

  15. Sheard, T., Linger, N.: Programming in Ωmega. In: Proc. Central European Functional Programming School, pp. 158–227 (2007)

    Google Scholar 

  16. Sheard, T., Peyton Jones, S.: Template meta-programming for Haskell. In: Proc. Haskell Workshop, pp. 1–16 (2002)

    Google Scholar 

  17. Taha, W.: Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology (1993)

    Google Scholar 

  18. Taha, W., Nielsen, M.F.: Environment classifiers. In: Proc. POPL, pp. 26–37 (2003)

    Google Scholar 

  19. Tratt, L.: Compile-time meta-programming in a dynamically typed OO language. In: Proc. DLS, pp. 49–64 (October 2005)

    Google Scholar 

  20. Westbrook, E., Ricken, M., Inoue, J., Yao, Y., Abdelatif, T., Taha, W.: Mint: Java multi-stage programming using weak separability. In: Proc. PLDI (2010) (to appear)

    Google Scholar 

  21. Yoshida, N., Honda, K., Berger, M.: Logical reasoning for higher-order functions with local state. In: Seidl, H. (ed.) FOSSACS 2007. LNCS, vol. 4423, pp. 361–377. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Berger, M., Tratt, L. (2010). Program Logics for Homogeneous Meta-programming. In: Clarke, E.M., Voronkov, A. (eds) Logic for Programming, Artificial Intelligence, and Reasoning. LPAR 2010. Lecture Notes in Computer Science(), vol 6355. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-17511-4_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-17511-4_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-17510-7

  • Online ISBN: 978-3-642-17511-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics