Abstract
We present the meta-theory behind the code generation facilities of Isabelle/HOL. To bridge the gap between the source (higher-order logic with type classes) and the many possible targets (functional programming languages), we introduce an intermediate language, Mini-Haskell. To relate the source and the intermediate language, both are given a semantics in terms of higher-order rewrite systems (HRSs). In a second step, type classes are removed from Mini-Haskell programs by means of a dictionary translation; we prove the correctness of this step. Building on equational logic also directly supports a simple but powerful algorithm and data refinement concept.
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
Berghofer, S., Bulwahn, L., Haftmann, F.: Turning inductive into equational specifications. In: Urban, C. (ed.) TPHOLs 2009. LNCS, vol. 5674, pp. 131–146. Springer, Heidelberg (2009)
Berghofer, S., Nipkow, T.: Executing higher order logic. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 24–40. Springer, Heidelberg (2002)
Berghofer, S., Nipkow, T.: Random testing in Isabelle/HOL. In: Second International Conference on SEFM 2004: Proc. of the Software Engineering and Formal Methods. IEEE Computer Society, Los Alamitos (2004)
Crow, J., Owre, S., Rushby, J., Shankar, N., Stringer-Calvert, D.: Evaluating, testing, and animating PVS specifications. Tech. rep., Computer Science Laboratory, SRI International (2001)
Greve, D.A., Kaufmann, M., Manolios, P., Moore, J.S., Ray, S., Ruiz-Reina, J.L., Sumners, R., Vroon, D., Wilding, M.: Efficient execution in an automated reasoning environment. Journal of Functional Programming 18(1), 15–46 (2007)
Haftmann, F.: Code generation from specifications in higher order logic. Ph.D. thesis, Technische Universität München (2009)
Hall, C., Hammond, K., Peyton Jones, S., Wadler, P.: Type classes in Haskell. ACM Transactions on Programming Languages and Systems 18(2) (1996)
Jones, C.B.: Systematic Software Development using VDM, 2nd edn. Prentice Hall International, Englewood Cliffs (1990)
Jones, M.P.: Qualified types: Theory and practice. Ph.D. thesis, University of Nottingham (1994)
Letouzey, P.: Programmation fonctionnelle certifiée – l’extraction de programmes dans l’assistant Coq. Ph.D. thesis, Université Paris-Sud (2004)
Letouzey, P.: Coq Extraction, an Overview. In: Beckmann, A., Dimitracopoulos, C., Löwe, B. (eds.) CiE 2008. LNCS, vol. 5028, pp. 359–369. Springer, Heidelberg (2008)
Lochbihler, A.: Formalising FinFuns - generating code for functions as data from Isabelle/HOL. In: Urban, C. (ed.) TPHOLs 2009. LNCS, vol. 5674, pp. 310–326. Springer, Heidelberg (2009)
Mayr, R., Nipkow, T.: Higher-order rewrite systems and their confluence. Theor. Comput. Sci. 192, 3–29 (1998)
Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)
Nipkow, T., Prehofer, C.: Type checking type classes. In: Proc. 20th ACM Symp. Principles of Programming Languages. ACM Press, New York (1993)
Nipkow, T., Prehofer, C.: Type reconstruction for type classes. J. Functional Programming 5(2), 201–224 (1995)
Okasaki, C.: Catenable double-ended queues. In: Proc. Int. Conf. Functional Programming (ICFP 1997). ACM Press, New York (1997)
Schmidt-Schauß, M.: Computational aspects of an order-sorted logic with term declarations. LNAI 395. Springer (1989)
Thiemann, R., Sternagel, C.: Certification of termination proofs using CeTA. In: Urban, C. (ed.) TPHOLs 2009. LNCS, vol. 5674, pp. 452–468. Springer, Heidelberg (2009)
Wehr, S.: ML modules and Haskell type classes: A constructive comparison. Master’s thesis, Albert-Ludwigs-Universität, Freiburg (2005)
Wehr, S., Chakravarty, M.M.T.: ML modules and Haskell type classes: A constructive comparison. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 188–204. Springer, Heidelberg (2008)
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
Haftmann, F., Nipkow, T. (2010). Code Generation via Higher-Order Rewrite Systems. In: Blume, M., Kobayashi, N., Vidal, G. (eds) Functional and Logic Programming. FLOPS 2010. Lecture Notes in Computer Science, vol 6009. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-12251-4_9
Download citation
DOI: https://doi.org/10.1007/978-3-642-12251-4_9
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-12250-7
Online ISBN: 978-3-642-12251-4
eBook Packages: Computer ScienceComputer Science (R0)