Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-45l2p Total loading time: 0 Render date: 2024-04-26T02:44:32.811Z Has data issue: false hasContentIssue false

16 - Nominal verification of algorithm W

Published online by Cambridge University Press:  06 August 2010

Christian Urban
Affiliation:
TU München
Tobias Nipkow
Affiliation:
TU München
Yves Bertot
Affiliation:
INRIA-Sophia Antipolis, France
Gérard Huet
Affiliation:
Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
Jean-Jacques Lévy
Affiliation:
Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
Gordon Plotkin
Affiliation:
University of Edinburgh
Get access

Summary

Abstract

The Milner-Damas typing algorithm W is one of the classic algorithms in computer science. In this paper we describe a formalized soundness and completeness proof for this algorithm. Our formalization is based on names for both term and type variables, and is carried out in Isabelle/HOL using the Nominal Datatype Package. It turns out that in our formalization we have to deal with a number of issues that are often overlooked in informal presentations of W.

Alpha-conversion always bites you when you least expect it.”

A remark made by Xavier Leroy when discussing with us the informal proof about W in his PhD thesis.

Introduction

Milner's polymorphic type system for ML is probably the most influential programming language type system. The second author learned about it from a paper by Clément et al. He was immediately taken by their view that type inference can be viewed as Prolog execution, in particular because the Isabelle system, which he had started to work on, was based on a similar paradigm as the Typol language developed by Kahn and his coworkers. Milner himself had provided the explicit type inference algorithm W and proved its soundness. Completeness was later shown by Damas and Milner. Neither soundness nor completeness of W are trivial because of the presence of the Let-construct (which is not expanded during type inference).

Type
Chapter
Information
From Semantics to Computer Science
Essays in Honour of Gilles Kahn
, pp. 363 - 382
Publisher: Cambridge University Press
Print publication year: 2009

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

[1]D., Clément, J., Despeyroux, T., Despeyroux, L., Hascoet and G., Kahn. Natural semantics on the computer. In K., Fuchi and M., Nivat (eds), Proceedings of the France-Japan AI and CS Symposium, ICOT, Japan, pp. 49–89, 1986. Also Technical Memorandum PL-86-6 Information Processing Society of Japan and Rapport de recherche #0416, INRIA.Google Scholar
[2]D., Clément, J., Despeyroux, T., Despeyroux and G., Kahn. A simple applicative language: Mini-ML. In Proc. ACM Conf. Lisp and Functional Programming, pp. 13–27, 1986.Google Scholar
[3]L., Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, 1984.
[4]L., Damas and R., Milner. Principal type schemes for functional programs. In Proc. 9th ACM Symp. Principles of Programming Languages, pp. 207–212, 1982.Google Scholar
[5]C., Dubois and V., Ménissier-Morain. Certification of a type inference tool for ML: Damas-Milner within Coq. Journal of Automated Reasoning, 23:319–346, 1999.Google Scholar
[6]C. A., Gunter. Semantics of Programming Languages. MIT Press, 1992.Google Scholar
[7]X., Leroy. Polymorphic Typing of an Algorithmic Language. PhD thesis, University Paris 7, 1992. INRIA Research Report, No 1778.
[8]R., Milner. A theory of type polymorphism in programming. Journal of Computer Systems Science, 17:348–375, 1978.Google Scholar
[9]W., Naraschewski and T., Nipkow. Type inference verified: Algorithm W in Isabelle/HOL. Journal of Automated Reasoning, 23:299–318, 1999.Google Scholar
[10]T., Nipkow and L. C., Paulson. Proof pearl: Defining functions over finite sets. In J., Hurd (ed.) Theorem Proving in Higher Order Logics (TPHOLs 2005), volume 3603, Lecture Notes in Computer Science, pp. 385–396. Springer-Verlag, 2005.Google Scholar
[11]A. M., Pitts. Nominal logic, A first order theory of names and binding. Information and Computation, 186:165–193, 2003.Google Scholar
[12]A. M., Pitts and M. J., Gabbay. A metalanguage for programming with bound names modulo renaming. In Proc. of the 5th International Conference on Mathematics of Program Construction (MPC), volume 1837, Lecture Notes in Computer Science, pp. 230–255. Springer-Verlag, 2000.Google Scholar
[13]M., Tofte. Operational Semantics and Polymorphic Type Inference. PhD thesis. Edinburgh University, 1988.
[14]C., Urban and S., Berghofer. A recursion combinator for nominal datatypes implemented in Isabelle/HOL. In Proc. of the 3rd International Joint Conference on Automated Reasoning (IJCAR), volume 4130, Lecture Notes in Artificial Intelligence, pp. 498–512. Springer-Verlag, 2006.Google Scholar
[15]C., Urban, S., Berghofer and M., Norrish. Barendregt's variable convention in rule inductions. In Proc. of the 21th International Conference on Automated Deduction (CADE), volume 4603, Lecture Notes in Artificial Intelligence, pp. 35–50. Springer-Verlag, 2007.Google Scholar
[16]C., Urban and C., Tasson. Nominal Techniques in Isabelle/HOL. In Proc. of the 20th International Conference on Automated Deduction (CADE), volume 3632, Lecture Notes in Computer Science, pp. 38–53, Springer-Verlag, 2005.Google Scholar

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×