Hostname: page-component-7c8c6479df-ph5wq Total loading time: 0 Render date: 2024-03-19T08:38:31.826Z Has data issue: false hasContentIssue false

A certified implementation of ML with structural polymorphism and recursive types

Published online by Cambridge University Press:  11 November 2014

JACQUES GARRIGUE*
Affiliation:
Graduate School of Mathematical Sciences, Nagoya University, Chikusa-ku, Nagoya 464-8602, Japan Email: garrigue@math.nagoya-u.ac.jp

Abstract

The type system of Objective Caml has many unique features, which make ensuring the correctness of its implementation difficult. One of these features is structurally polymorphic types, such as polymorphic object and variant types, which have the extra specificity of allowing recursion. We implemented in Coq a certified interpreter for Core ML extended with structural polymorphism and recursion. Along with type soundness of evaluation, soundness and principality of type inference, and correctness of a stack-based interpreter, are also proved.

Type
Paper
Copyright
Copyright © Cambridge University Press 2014 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Aydemir, B., Charguéraud, A., Pierce, B. C., Pollack, R. and Weirich, S. (2008) Engineering formal metatheory. In: Proceeding of the ACM Symposium on Principles of Programming Languages 3–15.CrossRefGoogle Scholar
Aydemir, B. E., Bohannon, A., Fairbairn, M., Foster, J. N., Pierce, B. C., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S., and Zdancewic, S. (2005) Mechanized metatheory for the masses: The PoplMark challenge. In: Proceeding of the International Conference on Theorem Proving in Higher Order Logics. Springer lecture notes in computer science 3603 5065.Google Scholar
Barras, B. (1999) Auto-Validation d'un Système de Preuves avec Familles Inductives, Thèse de doctorat, Université Paris 7.Google Scholar
Crary, K. and Harper, B.. (2009) Mechanized definition of Standard ML alpha release. Twelf proof scripts.Google Scholar
Dubois, C. (2000) Proving ML type soundness within Coq. In: Proceeding of the International Conference on Theorem Proving in Higher Order Logics. Springer lecture notes in computer science 1869 126144.Google Scholar
Dubois, C. and Ménissier-Morain, V.. (1999) Certification of a type inference tool for ML: Damas-Milner within Coq. Journal of Automated Reasoning 23 (3)319346.Google Scholar
Furuse, J. P. and Garrigue, J. (1995) A label-selective lambda-calculus with optional arguments and its compilation method. RIMS Preprint 1041, Research Institute for Mathematical Sciences, Kyoto University.Google Scholar
Garrigue, J. (1998) Programming with polymorphic variants. In: ML Workshop, Baltimore.Google Scholar
Garrigue, J. (2002) Simple type inference for structural polymorphism. In: The 9th International Workshop on Foundations of Object-Oriented Languages. Portland, Oregon.Google Scholar
Garrigue, J. (2004) Relaxing the value restriction. In: Proceeding International Symposium on Functional and Logic Programming. Springer Lecture Notes in Computer Science 2998 196213.CrossRefGoogle Scholar
Garrigue, J. (2010) A certified implementation of ML with structural polymorphism. In: Proceeding Asian Symposium on Programming Languages and Systems. Springer-Verlag 6461 360375. (Shanghai)Google Scholar
Garrigue, J. and Rémy, D. (1999) Extending ML with semi-explicit higher order polymorphism. Information and Computation 155 134171.CrossRefGoogle Scholar
Lee, D.K., Crary, K. and Harper, R. (2007) Towards a mechanized metatheory of standard ML. In: Proceeding ACM Symposium on Principles of Programming Languages 173–184.Google Scholar
Leroy, X., Doligez, D., Garrigue, J., Rémy, D. and Vouillon, J. (2008) The Objective Caml system release 3.11, Documentation and user's manual, Projet Gallium, INRIA.Google Scholar
Naraschewski, W. and Nipkow, T. (1999) Type inference verified: Algorithm W in Isabelle/HOL. Journal of Automated Reasoning 23 299318.Google Scholar
Odersky, M., Sulzmann, M. and Wehr, M. (1999) Type inference with constrained types. Theory and Practice of Object Systems 5 (1)3555.Google Scholar
Oheimb, D. v. and Nipkow, T. (1999) Machine-checking the Java specification: Proving type-safety. In: Alves-Foss, J. (ed.) Formal Syntax and Semantics of Java. Springer Lecture Notes in Computer Science 1523 119156.Google Scholar
Ohori, A. (1995) A polymorphic record calculus and its compilation. ACM Transactions on Programming Languages and Systems 17 (6)844895.Google Scholar
Owens, S. (2008) A sound semantics for OCaml light. In: Proceeding European Symposium on Programming. Springer Lecture Notes in Computer Science 4960 115.Google Scholar
Paulson, L. (1985) Verifying the unification algorithm in LCF. Science of Computer Programming 5 143169.Google Scholar
Rémy, D. (1989) Typechecking records and variants in a natural extension of ML. In: Proceeding ACM Symposium on Principles of Programming Languages 77–87.Google Scholar
The Coq Team. (2009) The Coq Proof Assistant, Version 8.2. INRIA.Google Scholar
Tobin-Hochstadt, S. and Felleisen, M. (2008) The design and implementation of typed scheme. In: Proceeding ACM Symposium on Principles of Programming Languages 395–406.Google Scholar
Urban, C. and Nipkow, T. (2009) Nominal verification of algorithm W. In: Huet, G., Lévy, J.-J. and Plotkin, G. (eds.) From Semantics to Computer Science. Essays in Honour of Gilles Kahn, Cambridge University Press 363382.Google Scholar