Computer Laboratory, Cambridge University; New Museums Site, Pembroke
SVM HeaderParse 0.2
Street; Cambridge CB2 3QG; United Kingdom
SVM HeaderParse 0.1
We describe a variant of Milner's ML type inference algorithm which can be used to perform incremental type checking of programs with partially unspecied functions (or predicates in Prolog). This supports modication (e.g. for correction) of procedures dened previously and provides for a convenient treatment of top-level mutual recursion including Prolog-style incremental clausal denition. The system allows us to: dene a function of, say, type ! , use it in suceeding functions and then modify its denition to a type instance, such as list( int) ! list( int), provided that, in the meantime, it has not been used by other functions at an incompatible instance. Undened procedures can be treated as having type (or ! corresponding to the function x:fail ). This is useful for the case of languages (like HOPE, Miranda, Haskell and Prolog) which require that all top-level procedures are dened mutually recursively | forward references can then be treated as if dened by x...