Breaking through then3 barrier: Faster object type inference

Fritz Henglein · Theory and Practice of Object Systems · 1999

Abadi and Cardelli [1] present a series of type systems for their object calculi, four of which are first-order. Palsberg [22] has shown how typability in each one of these systems can be decided in time O(n3) and space O(n2), where n is the size of an untyped object expression, using an algorithm based on dynamic transitive closure. In this paper we improve each one of the four type inference problems from O(n3) to the following time complexities: [see article pdf to view table] Furthermore, our algorithms improve the space complexity from O(n2) to O(n) in each case. The key ingredient that lets us “beat” the worst-case time and space complexity induced by general dynamic transitive closure or similar algorithmic methods is that object subtyping, in contrast to record subtyping, is invariant: an object type is a subtype of a “shorter” type with a subset of the method names if and only if the common components have equal types. © 1999 John Wiley & Sons, Inc.

Read the paper · More papers on PaperTik