Abstract
We address the problem of developing mechanisms for easily implementing modular extensions to modular (logic) languages. By (language) extensions we refer to different groups of syntactic definitions and translation rules that extend a language. Our use of the concept of modularity in this context is twofold. We would like these extensions to be modular, in the sense above, i.e., we should be able to develop different extensions mostly separately. At the same time, the sources and targets for the extensions are modular languages, i.e., such extensions may take as input separate pieces of code and also produce separate pieces of code. Dealing with this double requirement involves interesting challenges to ensure that modularity is not broken: first, combinations of extensions (as if they were a single extension) must be given a precise meaning. Also, the separate translation of multiple sources (as if they were a single source) must be feasible. We present a detailed description of a code expansion-based framework that proposes novel solutions for these problems. We argue that the approach, while implemented for Ciao, can be adapted for other Prolog-based systems and languages.
Keywords
- Compilation
- Modules
- Modular Program Processing
- Separate Compilation
- Prolog
- Ciao
- Language Extensions
- Domain Specific Languages
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Cabeza, D., Hermenegildo, M.V.: A New Module System for Prolog. In: Palamidessi, C., Moniz Pereira, L., Lloyd, J.W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 131–148. Springer, Heidelberg (2000)
Cardelli, L.: Program fragments, linking, and modularization. In: POPL, pp. 266–277 (1997)
Casas, A., Cabeza, D., Hermenegildo, M.V.: A Syntactic Approach to Combining Functional Notation, Lazy Evaluation, and Higher-Order in LP Systems. In: Hagiya, M. (ed.) FLOPS 2006. LNCS, vol. 3945, pp. 146–162. Springer, Heidelberg (2006)
de Rauglaudre, D., Pouillard, N.: Camlp4, http://brion.inria.fr/gallium/index.php/Camlp4
Duck, G.J., De Koninck, L., Stuckey, P.J.: Cadmium: An Implementation of ACD Term Rewriting. In: Garcia de la Banda, M., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 531–545. Springer, Heidelberg (2008)
Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. J. Funct. Program. 13(3), 455–481 (2003)
Flatt, M.: PLT: Reference: Racket. Tech. Rep. PLT-TR-2010-1, PLT Inc. (2010), http://racket-lang.org/tr1/
Frühwirth, T.: Constraint Handling Rules. Cambridge University Press (August 2009)
Hermenegildo, M.V.: A Documentation Generator for (C)LP Systems. In: Palamidessi, C., Moniz Pereira, L., Lloyd, J.W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 1345–1361. Springer, Heidelberg (2000)
Hermenegildo, M.V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J., Puebla, G.: An Overview of Ciao and its Design Philosophy. Theory and Practice of Logic Programming (2011), http://arxiv.org/abs/1102.5497
Hudak, P.: Modular domain specific languages and tools. In: Proceedings of Fifth International Conference on Software Reuse, pp. 134–142. IEEE Computer Society Press (1998)
Jones, S.P., Tolmach, A., Hoare, T.: Playing by the rules: rewriting as a practical optimisation technique in GHC. In: Haskell Workshop (2001)
Schrijvers, T., Santos Costa, V., Wielemaker, J., Demoen, B.: Towards Typed Prolog. In: Garcia de la Banda, M., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 693–697. Springer, Heidelberg (2008)
Sheard, T., Jones, S.L.P.: Template meta-programming for haskell. In: Haskell Workshop, vol. 37(12), pp. 60–75 (2002)
Wielemaker, J., Santos-Costa, V.: On the Portability of Prolog Applications. In: Rocha, R., Launchbury, J. (eds.) PADL 2011. LNCS, vol. 6539, pp. 69–83. Springer, Heidelberg (2011)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Morales, J.F., Hermenegildo, M.V., Haemmerlé, R. (2012). Modular Extensions for Modular (Logic) Languages. In: Vidal, G. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2011. Lecture Notes in Computer Science, vol 7225. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32211-2_10
Download citation
DOI: https://doi.org/10.1007/978-3-642-32211-2_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-32210-5
Online ISBN: 978-3-642-32211-2
eBook Packages: Computer ScienceComputer Science (R0)
