## Type Inference Verified: Algorithm W in Isabelle/HOL (1997)

### Cached

### Download Links

- [www4.informatik.tu-muenchen.de]
- [wwwbroy.informatik.tu-muenchen.de]
- [www.in.tum.de]
- [www4.informatik.tu-muenchen.de]
- DBLP

### Other Repositories/Bibliography

Citations: | 15 - 1 self |

### BibTeX

@MISC{Naraschewski97typeinference,

author = {Wolfgang Naraschewski and Tobias Nipkow},

title = {Type Inference Verified: Algorithm W in Isabelle/HOL},

year = {1997}

}

### Years of Citing Articles

### OpenURL

### Abstract

This paper presents the first machine-checked verification of Milner's type inference algorithm W for computing the most general type of an untyped -term enriched with let-expressions. This term language is the core of most typed functional programming languages and is also known as Mini-ML. We show how to model all the concepts involved, in particular types and type schemes, substitutions, and the thorny issue of "new" variables. Only a few key proofs are discussed in detail. The theories and proofs are developed in Isabelle/HOL, the HOL instantiation of the generic theorem prover Isabelle.

### Citations

1562 | The Definition of Standard ML - Miller, Tofte, et al. - 1990 |

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ... has a most general type. The computation of the most general type is called type inference. It was first studied by Hindley [10] in the context of combinatory logic and later independently by Milner =-=[12]-=- for Mini-ML. Milner's type inference algorithm is known as algorithm W. Damas [4, 5] proved the completeness of W. This paper presents the first machine-checked proof of correctness and completeness ... |

233 |
Principal type schemes for functional programs
- Damas, Milner
- 1982
(Show Context)
Citation Context ...nference. It was first studied by Hindley [10] in the context of combinatory logic and later independently by Milner [12] for Mini-ML. Milner's type inference algorithm is known as algorithm W. Damas =-=[4, 5]-=- proved the completeness of W. This paper presents the first machine-checked proof of correctness and completeness of W . It is an extension of the work by Nazareth and Nipkow [14], who treated the mo... |

225 | Report on programming language Haskel a non-strict, purely functional language version 1.2
- Hudak, Jones, et al.
- 1992
(Show Context)
Citation Context ...Types follow the syntax for ML-types, except that the function arrow is ) rather than !. A term t is constrained to be of type �� by writing t :: �� . Isabelle also provides Haskell-like type =-=classes [11]-=-, the details of which are explained as we go along. A type variable ff is restricted to be of class c by writing ff :: c. Theories introduce constants with the keyword consts, non-recursive definitio... |

218 | Unification revisited - Lassez, Maher, et al. - 1986 |

164 |
Isabelle: A generic theorem prover, volume 828
- Paulson
- 1994
(Show Context)
Citation Context ...ion of Higher Order Logic and is very close to Gordon's HOL system [8]. In the remainder of the paper HOL is short for Isabelle/HOL. A detailed introduction to Isabelle and HOL can be found elsewhere =-=[18]-=-. Logical expressions are written as usually, except for the fact that we use two different implications (=), )) and equalities (j, =). This distinction stems ? Research supported by Esprit WG TYPES a... |

161 | Solving equations in abstract algebras: A rulebased survey of unification - Jouannaud, Kirchner - 1991 |

154 |
de Bruijn. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the church-rosser theorem
- G
- 1972
(Show Context)
Citation Context ...at unification preserves the new type variable property: [[ mgu t1 t2 = Some U; new tv n t1; new tv n t2 ]] =) new tv n U 4 Well-Typed Expressions Lambda expressions are written in de Bruijn notation =-=[6]-=- as an inductive data type with constructors for variables, abstraction, application and let: datatype expr = Var nat j Abs expr j App expr expr j LET expr expr Note that by Var we denote variables of... |

142 |
The principal type-scheme of an object in combinatory logic
- Hindley
- 1969
(Show Context)
Citation Context ...s. One of the key properties of Mini-ML is that every well-typed expression has a most general type. The computation of the most general type is called type inference. It was first studied by Hindley =-=[10]-=- in the context of combinatory logic and later independently by Milner [12] for Mini-ML. Milner's type inference algorithm is known as algorithm W. Damas [4, 5] proved the completeness of W. This pape... |

110 | Type inference for polymorphic references - Tofte - 1990 |

97 |
A Simple Applicative Language: Mini-ML
- Clément, Despeyroux, et al.
- 1986
(Show Context)
Citation Context ...unctional programming languages [13, 11, 2] have a common core: the simply typed -calculus enriched with let-expressions, i.e. local definitions of polymorphic values. This language is called Mini-ML =-=[3]-=-. The set of well-typed Mini-ML expressions is inductively defined by a set of inference rules. One of the key properties of Mini-ML is that every well-typed expression has a most general type. The co... |

94 |
Type Assignment in Programming Languages
- Damas
- 1984
(Show Context)
Citation Context ...nference. It was first studied by Hindley [10] in the context of combinatory logic and later independently by Milner [12] for Mini-ML. Milner's type inference algorithm is known as algorithm W. Damas =-=[4, 5]-=- proved the completeness of W. This paper presents the first machine-checked proof of correctness and completeness of W . It is an extension of the work by Nazareth and Nipkow [14], who treated the mo... |

61 | Functional unification of higher-order patterns - Nipkow - 1993 |

43 |
Introduction to HOL: a theorem-proving environment for higher-order logic
- Gordon, Melham
- 1993
(Show Context)
Citation Context ...ntiated with different object logics. One particularly well-developed instantiation is Isabelle/HOL, which supports Church's formulation of Higher Order Logic and is very close to Gordon's HOL system =-=[8]-=-. In the remainder of the paper HOL is short for Isabelle/HOL. A detailed introduction to Isabelle and HOL can be found elsewhere [18]. Logical expressions are written as usually, except for the fact ... |

43 | Pure type systems formalized - McKinna, Pollack - 1993 |

41 | Compiler verification in LF
- Hannan, Pfenning
- 1992
(Show Context)
Citation Context ...iced) still incomplete informal proof of a type inference algorithm for Haskell's type classes. 2. a verified Mini-ML compiler. We are aware of two formal proofs of the back end of a Mini-ML compiler =-=[9, 1]-=-, unfortunately conducted in different systems (Elf and Coq). The time is ripe to combine these individual efforts. How does our proof compare to Damas'? 1. Despite the fact that we consulted his proo... |

39 | HOPE: An experimental applicative language
- Burstall, MacQueen, et al.
- 1980
(Show Context)
Citation Context ...es: sch's(sch::type scheme) j 8t. t !j sch' \Gamma! t !j sch Both !j andsare pronounced "is a generic instance of". The key property ofsis preservation under substitutions: sch'ssch =) $S sc=-=h's$S sch (2)-=- This proposition looks simple enough but its proof eluded us until we consulted Damas [5, Prop. 10, p. 51], where this very lemma is proved. Damas uses an alternative characterization of sch'ssch: sc... |

26 | Generic automatic proof tools
- Paulson
- 1997
(Show Context)
Citation Context ... indicate their complexity. If we do not state any complexity the proof is almost automatic. That means, it is either solved by rewriting or by the "classical reasoner", fast tac in Isabelle=-= parlance [19]-=-. The latter provides a reasonable degree of automation for predicate calculus proofs. Note, however, that its success depends on the right selection of lemmas supplied as parameters. 3 Types, type va... |

23 | Type reconstruction for type classes
- Nipkow, Prehofer
- 1995
(Show Context)
Citation Context ...o pass the set of already used type variables as an argument to W , add all new variables generated during the execution to this set, and return the enlarged set upon successful termination (see e.g. =-=[16]-=-). Because our type variables are natural numbers and thus ordered linearly, it suffices to pass W a counter instead of a set of variables and to increment the counter every time a new variable is nee... |

10 | Formal Verification of Algorithm W: The Monomorphic case
- Nazareth, Nipkow
- 1996
(Show Context)
Citation Context ...lgorithm W. Damas [4, 5] proved the completeness of W. This paper presents the first machine-checked proof of correctness and completeness of W . It is an extension of the work by Nazareth and Nipkow =-=[14]-=-, who treated the monomorphic case (no let-expressions). A partial verification of W in the proof checker Coq is reported by Dubois and M'enissier-Morain [7]. Our paper provides the definition of (due... |

9 | Verifying the Unification Algorithm in LCF
- Paulson
- 1985
(Show Context)
Citation Context ...hosen to formalize substitutions as ordinary functions: types subst = nat ) typ This is not just in contrast to the informal literature, but also to other formal verifications involving substitutions =-=[17, 7]-=-, which use association lists. The two reasons for our choice are: 1. We believe that functions are easier to handle than association lists. 2. We wanted to find out if the restriction to finite funct... |

7 | Primitive recursion for higher order abstract syntax with dependent types - Despeyroux, Leleu - 1999 |

2 |
Preuve de correction de la compilation de mini-ml en code cam dans le syst`eme d'aide `a la d'emonstration coq
- Boutin
- 1995
(Show Context)
Citation Context ...iced) still incomplete informal proof of a type inference algorithm for Haskell's type classes. 2. a verified Mini-ML compiler. We are aware of two formal proofs of the back end of a Mini-ML compiler =-=[9, 1]-=-, unfortunately conducted in different systems (Elf and Coq). The time is ripe to combine these individual efforts. How does our proof compare to Damas'? 1. Despite the fact that we consulted his proo... |

2 |
A proved type inference tool for ML: Damas-Milner within Coq (work in progress
- Dubois, M'enissier-Morain
- 1996
(Show Context)
Citation Context ...ension of the work by Nazareth and Nipkow [14], who treated the monomorphic case (no let-expressions). A partial verification of W in the proof checker Coq is reported by Dubois and M'enissier-Morain =-=[7]-=-. Our paper provides the definition of (due to lack of space: almost) all concepts, the key lemmas, but almost no proofs. The complete development is accessible via http://www4.informatik.tu-muenchen.... |