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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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)
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)
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)
Berger, M., Tratt, L.: Program Logics for Homogeneous Metaprogramming. Long version of the present paper (to appear)
Cook, S.A.: Soundness and completeness of an axiom system for program verification. SIAM J. Comput. 7(1), 70–90 (1978)
Davies, R., Pfenning, F.: A modal analysis of staged computation. J. ACM 48(3), 555–604 (2001)
Fogarty, S., Pašalić, E., Siek, J., Taha, W.: Concoqtion: Indexed Types Now! In: Proc. PEPM, pp. 112–121 (2007)
Gunter, C.A.: Semantics of Programming Languages. MIT Press, Cambridge (1995)
Honda, K.: From Process Logic to Program Logic. In: ICFP 2004, pp. 163–174. ACM Press, New York (2004)
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)
Honda, K., Yoshida, N.: A compositional logic for polymorphic higher-order functions. In: Proc. PPDP, pp. 191–202 (2004)
Honda, K., Yoshida, N., Berger, M.: An Observationally Complete Program Logic for Imperative Higher-Order Functions. In: LICS 2005, pp. 270–279 (2005)
Longley, J., Plotkin, G.: Logical Full Abstraction and PCF. In: Tbilisi Symposium on Logic, Language and Information, CSLI (1998)
Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: Proc. LICS 2002, pp. 55–74 (2002)
Sheard, T., Linger, N.: Programming in Ωmega. In: Proc. Central European Functional Programming School, pp. 158–227 (2007)
Sheard, T., Peyton Jones, S.: Template meta-programming for Haskell. In: Proc. Haskell Workshop, pp. 1–16 (2002)
Taha, W.: Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology (1993)
Taha, W., Nielsen, M.F.: Environment classifiers. In: Proc. POPL, pp. 26–37 (2003)
Tratt, L.: Compile-time meta-programming in a dynamically typed OO language. In: Proc. DLS, pp. 49–64 (October 2005)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)