Abstract
A metaprogram is a program that takes programs as inputs and performs some useful computation. It may, for example, transform one program into another. Or it may analyze such a program with respect to some properties, or perform other useful program-dependent computations. This is of course very useful and very powerful. In Maude, metaprogramming has a logical, reflective semantics. It is just a direct consequence of the fact that both membership equational logic and rewriting logic are reflective logics, and of the efficient exploitation of that fact in the META-LEVEL module. That is, we can easily write Maude metaprograms by importing META-LEVEL into a module that defines such metaprograms as functions that have Module as one of their arguments. Since this is one of the most powerful uses of Maude as a programming language, we present in this chapter three metaprogramming examples of moderate size, yet interesting and nontrivial, that can be helpful as an appetizer and guide to more ambitious metaprogramming tasks. Much more ambitious examples, also freely available for inspection, are the Full Maude system itself (see Chapter 18), which is a metaprogram entirely written in Maude, and the various tools in Maude’s formal environment, which are described in Section 21.1.
This is a preview of subscription content, log in via an 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.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this chapter
Cite this chapter
Clavel, M. et al. (2007). Metaprogramming Applications. In: All About Maude - A High-Performance Logical Framework. Lecture Notes in Computer Science, vol 4350. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71999-1_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-71999-1_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-71940-3
Online ISBN: 978-3-540-71999-1
eBook Packages: Computer ScienceComputer Science (R0)