skip to main content
research-article

Modular logic metaprogramming

Published:17 October 2010Publication History
Skip Abstract Section

Abstract

In logic metaprogramming, programs are not stored as plain textfiles but rather derived from a deductive database. While the benefits of this approach for metaprogramming are obvious, its incompatibility with separate checking limits its applicability to large-scale projects. We analyze the problems inhibiting separate checking and propose a class of logics that reconcile logic metaprogramming and separate checking. We have formalized the resulting module system and have proven the soundness of separate checking. We validate its feasibility by presenting the design and implementation of a specific logic that is able to express many metaprogramming examples from the literature.

References

  1. }}D. Ancona, F. Damiani, S. Drossopoulou, and E. Zucca. Polymorphic bytecode: Compositional compilation for Java-like languages. In Proceedings of the 32th Symposium on Principles of Programming Languages (POPL '05), New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}D. Ancona, G. Lagorio, and E. Zucca. Flexible type-safe linking of components for Java-like languages. In Proceedings of the 7th Joint Modular Languages Conference (JMLC '06), volume 4228 of Lecture Notes in Computer Science, pages 136--154, Berlin, Heidelberg, 2006. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}Chris Andreae, James Noble, Shane Markstrum, and Todd Millstein. A framework for implementing pluggable type systems. In Proceedings of the 21st conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA '06), pages 57--74, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}Don Batory. Feature models, grammars, and propositional formulas. In Proceedings of the 9th International Software Product Line Conference (SPLC '05), volume 3714 of Lecture Notes in Computer Science, Berlin, Heidelberg, 2005. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}David Benavides, Pablo Trinidad, and Antonio Ruiz-cortés. Automated reasoning on feature models. In Proceedings of the 17th Conference on Advanced Information Systems Engineering (CAiSE '05), volume 3520 of Lecture Notes in Computer Science, pages 491--503, Berlin, Heidelberg, 2005. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}Gilad Bracha. Pluggable type systems, 2004. OOPSLA Workshop on Revival of Dynamic Languages.Google ScholarGoogle Scholar
  7. }}Daniel Cabeza and Manuel Hermenegildo. A new module system for Prolog. In Computational Logic (CL 2000), volume 1861 of Lecture Notes in Computer Science, pages 131--148, Berlin, Heidelberg, 2000. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}Luca Cardelli. Program fragments, linking, and modularization. In Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages (POPL '97), pages 266--277, New York, 1997. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}S. Ceri, G. Gottlob, and L. Tanca. What you always wanted to know about datalog (and never dared to ask). IEEE Transactions on Knowledge and Data Engineering, 01(1):146--166, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}Arindam Chakrabarti, Luca de Alfaro, Thomas A. Henzinger, Marcin Jurdzinski, and Freddy Y. C. Mang. Interface compatibility checking for software modules. In Proceedings of the 14th International Conference on Computer Aided Verification (CAV '02), pages 428--441, Berlin, Heidelberg, 2002. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}Shigeru Chiba. A metaobject protocol for C++. In Proceedings of the 10th conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA '95), pages 285--299, New York, 1995. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}Shigeru Chiba. Load-time structural reflection in Java. In Proceedings of the 14th European Conference on Object-Oriented Programming (ECOOP '00), volume 1850 of Lecture Notes in Computer Science, pages 313--336, Berlin, Heidelberg, 2000. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}Luca de Alfaro and Thomas A. Henzinger. Interface automata. In Proceedings of the 8th European software engineering conference held jointly with 9th ACM SIGSOFT international symposium on Foundations of software engineering (ESEC/FSE-9), pages 109--120, New York, USA, 2001. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}Kris De Volder. Type-Oriented Logic Meta Programming. PhD thesis, Vrije Universiteit Brussel, 1998.Google ScholarGoogle Scholar
  15. }}Kris De Volder. Implementing design patterns as declarative code generators. http://www.cs.ubc.ca/ kdvolder/publications/design_patterns-abstract.ht%m, 2001.Google ScholarGoogle Scholar
  16. }}Kris De Volder, Johan Fabry, and Roel Wuyts. Logic meta components as a generic component model. In Fifth International Workshop on Component-Oriented Programming, Workshop reader of ECOOP '00, 2000.Google ScholarGoogle Scholar
  17. }}Dirk Draheim, Christof Lutteroth, and Gerald Weber. A type system for reflective program generators. In Proceedings of the 4th international conference on Generative programming and component engineering (GPCE '05), Lecture Notes in Computer Science, pages 327--341, Berlin, Heidelberg, 2005. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}Michael Eichberg, Sven Kloppenburg, Karl Klose, and Mira Mezini. Defining and continuous checking of structural program dependencies. In Proceedings of the 30th international conference on Software engineering (ICSE '08), pages 391--400, New York, NY, USA, 2008. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}Manuel Fahndrich, Michael Carbin, and James R. Larus. Reflective program generation with patterns. In Proceedings of the 5th international conference on Generative programming and component engineering (GPCE '06), pages 275--284, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}Robert Bruce Findler, Mario Latendresse, and Matthias Felleisen. Behavioral contracts and behavioral subtyping. In Proceedings of the 8th European software engineering conference held jointly with 9th ACM SIGSOFT international symposium on Foundations of software engineering (ESEC/FSE-9), pages 229--236, New York, NY, USA, 2001. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns. Addison-Wesley Professional, Indianapolis, USA, January 1995.Google ScholarGoogle Scholar
  22. }}J.A. Goguen and R.M. Burstall. Introduction to institutions. In Logic of Programs, Workshop, Carnegie Mellon University, volume 164 of Lecture Notes in Computer Science, pages 221--256. Springer Verlag, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}Elnar Hajiyev, Mathieu Verbaere, and Oege de Moor. Codequest: Scalable source code queries with datalog. In Proceedings of the 20th European conference on Object oriented programming (ECOOP '06), volume 4067 of Lecture Notes in Computer Science, pages 2--27, Berlin, Heidelberg, 2006. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}P. Hill. A module system for meta-programming. Logic Program Synthesis and Transformation - Meta-Programming in Logic, 883:395--409, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}Shan S. Huang and Yannis Smaragdakis. Expressive and safe static reflection with MorphJ. In Proceedings of the 2008 ACM SIGPLAN conference on Programming language design and implementation (PLDI '08), pages 79--89, New York, NY, USA, 2008. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}Shan S. Huang, David Zook, and Yannis Smaragdakis. cJ: enhancing Java with safe type conditions. In Proceedings of the 6th international conference on Aspect-oriented software development (AOSD '07), pages 185--198, New York, NY, USA, 2007. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. }}Shan S. Huang, David Zook, and Yannis Smaragdakis. Morphing: Safely Shaping a Class in the Image of Others. In Proceedings of the 21st European Conference on Object-Oriented Programming (ECOOP '07), Berlin, Heidelberg, 2007. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. }}Shan Shan Huang, David Zook, and Yannis Smaragdakis. Statically safe program generation with safegen. In Proceedings of the 4th international conference on Generative programming and component engineering (GPCE '05), Lecture Notes in Computer Science, pages 309--326. Springer Verlag, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. }}Evelina Lamma and Paola Mello. Modularity in logic programming. In Proceedings of the eleventh international conference on Logic programming, pages 15--17, Cambridge, MA, USA, 1994. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. }}Kim Mens, Isabel Michiels, and Roel Wuyts. Supporting software development through declaratively codified programming patterns. In Journal on Expert Systems with Applications, pages 236--243, New York, NY, USA, 2001. Elsevier Science Inc.Google ScholarGoogle Scholar
  31. }}Dale Miller. A logical analysis of modules in logic programming. J. Log. Program., 6(1-2):79--108, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. }}Gopalan Nadathur, Bharat Jayaraman, and Keehang Kwon. Scoping constructs in logic programming: Implementation problems and their solutions. J. Log. Program., 25(2):119--161, 1995.Google ScholarGoogle ScholarCross RefCross Ref
  33. }}Gopalan Nadathur and Dale Miller. An overview of łProlog. In Proceedings of the Fifth International Logic Programming Conference, pages 810--827, Cambridge, MA, USA, 1988. MIT Press.Google ScholarGoogle Scholar
  34. }}Klaus Ostermann, Mira Mezini, and Christoph Bockisch. Expressive pointcuts for increased modularity. In Proceedings of the 19th European Conference on Object-Oriented Programming (ECOOP '05), volume 3586 of Lecture Notes in Computer Science, pages 214--240, Berlin, Heidelberg, 2005. Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. }}D. L. Parnas. On the criteria to be used in decomposing systems into modules. Communications of the ACM, 15(12):1053--1058, December 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. }}Raymond Reiter. On closed world databases. In Logic and Databases, pages 55--76, New York, NY, USA, 1978. Plenum Press.Google ScholarGoogle Scholar
  37. }}Ehud Shapiro and Leon Sterling. The Art of PROLOG: Advanced Programming Techniques. The MIT Press, Cambridge, MA, USA, April 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. }}Walid Taha and Tim Sheard. Multi-stage programming with explicit annotations. In Proceedings of the 1997 symposium on Partial Evaluation and semantics-based Program Manipulation (PEPM '97), pages 203--217, New York, USA, 1997. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. }}Roel Wuyts. A Logic Meta Programming Approach to Support the Co-Evolution of Object-Oriented Design and Implementation. PhD thesis, Vrije Universiteit Brussel, 2001.Google ScholarGoogle Scholar

Index Terms

  1. Modular logic metaprogramming

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 45, Issue 10
            OOPSLA '10
            October 2010
            957 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1932682
            Issue’s Table of Contents
            • cover image ACM Conferences
              OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applications
              October 2010
              984 pages
              ISBN:9781450302036
              DOI:10.1145/1869459

            Copyright © 2010 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 17 October 2010

            Check for updates

            Qualifiers

            • research-article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!