Library Open Repository

Subtype inference in functional languages


Downloads per month over past year

Dekker, AH (1989) Subtype inference in functional languages. PhD thesis, University of Tasmania.

PDF (Whole thesis)
whole-dekker-th...pdf | Download (5MB)
Available under University of Tasmania Standard License.


This thesis describes techniques for efficiently performing polymorphic type
inference for functional programming languages in the presence of subtype
relationships. We permit subtype relationships which are based on implicit
coercion functions between primitive types or type constructors, such as
between integers and reals or between lists of arbitrary type and sets of the
same type. Coercions between different kinds of functions are also
pennitted. In particular, finite database functions can be coerced to general
functions. This makes functional languages useful as database query and
update languages.
In the first chapter we describe basic notation, and define a subtype ordering
to be a partial order on type variables and type constructors, satisfying
certain conditions which ensure that the inequalities in a subtype ordering
always have a solution. We define a number of operations for manipulating
subtype orderings, which exploit the representation of subtype orderings as
transitively reduced directed acyclic graphs. Generic operations such as
addition are given a type scheme containing a subtype ordering which
constrains the bound variables. Colouring of type variables imposes a
further constraint, which allows a type scheme to be given to the equality
The second chapter defines a simple functional language and gives inference
rules which type-annotate expressions. A number of additional rules are
derived, including a rule for applying a substitution to a typing assertion. We
provide a rewrite rule semantics for typed expressions, and show that this
preserves typing information and is Church-Rosser. Since coercions produce
a unique result and commute with primitive operations, including equality,
we conjecture that type-annotating an expression is semantically
In the third chapter we give a sound and complete, but naive, type inference
algorithm which is inefficient, since intermediate subtype orderings rapidly
become large. Standardisations and simplifications, which reduce the size of
subtype orderings without loss of generality, lead to a more efficient type
inference algorithm, which is quartic-time for expressions, but which we
expect to be linear for typical user programs.
The fourth chapter applies this work to database query and update, using the
Functional Data Model. A case study involving a hospital database shows the
utility of subtype inference.

Item Type: Thesis (PhD)
Additional Information:

Copyright the Author-The University is continuing to endeavour to trace the copyright owner(s) and in the meantime this item has been reproduced here in good faith. We would be pleased to hear from the copyright owner(s)

Date Deposited: 24 Jun 2014 01:14
Last Modified: 11 Mar 2016 05:55
Item Statistics: View statistics for this item

Actions (login required)

Item Control Page Item Control Page