Abstract
We develop a formal proof of the ML type inference algorithm, within the Coq proof assistant. We are much concerned with methodology and reusability of such a mechanization. This proof is an essential step toward the certification of a complete ML compiler.
In this paper we present the Coq formalization of the typing system and its inference algorithm. We establish formally the correctness and the completeness of the type inference algorithm with respect to the typing rules of the language. We describe and comment on the mechanized proofs.
Similar content being viewed by others
References
Barras, B., Boutin, S., Cornes, C., Courant, J., Filliâtre, J., Giménez, E., Herbelin, H., Huet, G., Manoury, P., Muñoz, C., Murthy, C., Parent, C., Paulin-Mohring, C., Saïbi, A. and Werner, B.: The Coq proof assistant, reference manual, Version 6.1, INRIA, Rocquencourt, December 1996. Also available at http://pauillac.inria.fr/coq/doc/main.html.
Boutin, S.: Proving correctness of the translation from mini-ML to the CAMwith the Coq proof development system, Research Report RR-2536, INRIA, Rocquencourt, April 1995.
Clement, D., Despeyroux, J., Despeyroux, T. and Kahn, G.: A simple applicative language: Mini-ML, in Proceedings of the ACM Conference on Lisp and Functional Programming, August 1986. Also available as Research Report RR-529, INRIA, Sophia-Antipolis, May 1986.
Damas, L. and Milner, R.: Principal type-schemes for functional programs, in Proceedings of the 15th Annual Symposium on Principles of Programming Languages, ACM, 1982, pp. 207-212.
Dubois, C.: Sûreté du typage de ML: Spécification et Preuve en Coq. 9èmes Journées Francophones des Langages Applicatifs, Côme, Italie, 1998.
Dubois, C. and Ménissier-Morain, V.: A proved type inference tool for ML: Damas-Milner within Coq (work in progress), in J. von Wright, J. Grundy and J. Harrison (eds.), Supplementary Proceedings of Theorem Proving in Higher Order Logics, Turku Centre for Computer Science, 1996, pp. 15-30.
Dubois, C., Rouaix, F. and Weis, P.: Extensional polymorphism, in Proceedings of the 22th ACM Conference on Principles of Programming Languages, January 1995, pp. 118-129.
Dubois, C. and Viguié Donzeau-Gouge, V.: A step towards the mechanization of partial functions: Domains as inductive predicates, CADE-15, Workshop on Mechanization of Partial Functions, Lindau, 1998.
Jaume, M.: Unification: A case study in transposition of formal properties, in E. L. Gunter and A. Felty (eds.), Supplementary Proceedings of the 10th International Conference on Theorem Proving in Higher Order Logics: Poster Session TPHOLs'97, Murray Hill, NJ, 1997, pp. 79-93.
Kahn, G.: Natural semantics, in Proceedings of the Symposium on Theoretical Aspects of Computer Science, 1987.
Leroy, X.: Polymorphic typing of an algorithmic language. Research Report (English version of his Ph.D. Thesis at Université Paris 7) RR-1778, INRIA, Rocquencourt, 1992.
Naraschewski, W. and Nipkow, T.: Type inference verified: Algorithm W in Isabelle/HOL, J. Automated Reasoning, this issue.
Nazareth, D. and Nipkow, T.: Formal verification of algorithm W: The monomorphic case, in Proceedings of Theorem Proving in Higher Order Logics, LNCS 1125, Springer-Verlag, 1996, pp. 331-345.
Parent, C.: Developing certified programs in Coq - The program tactic, in H. Barendregt and T. Nipkow (eds.), Proceedings of the International Workshop on Types for Proofs and Programs, LNCS 806, Springer-Verlag, 1993, pp. 291-312.
Pfenning, F. and Paulin-Mohring, C.: Inductively defined types in the calculus of constructions, in Proceedings of Mathematical Foundations of Programming Semantics, LNCS 442, Springer-Verlag 1990.
Rouyer, J.: Développement de l'algorithme d'unification dans le calcul des constructions avec types inductifs, INRIA-Lorraine, Research Report 1795, November 1992.
Terrasse, D.: Encoding natural semantics in Coq, in Proceedings of the Fourth International Conference on Algebraic Methodology and Software Technology (AMAST'95), LNCS 936, Springer-Verlag, July 1995.
Wright, A. K.: Simple imperative polymorphism, Lisp and Symbolic Computation, 1994.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Dubois, C., Ménissier-Morain, V. Certification of a Type Inference Tool for ML: Damas–Milner within Coq. Journal of Automated Reasoning 23, 319–346 (1999). https://doi.org/10.1023/A:1006285817788
Issue Date:
DOI: https://doi.org/10.1023/A:1006285817788