Coercion as homomorphism: type inference in a system with subtyping and overloading

  • Authors:
  • Alex Shafarenko

  • Affiliations:
  • University of Hertfordshire, AL10 9AB, U.K.

  • Venue:
  • Proceedings of the 4th ACM SIGPLAN international conference on Principles and practice of declarative programming
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

A type system with atomic subtyping and a special form of operator overloading, which we call offset-homomorphism is proposed. A set of operator overloadings is said to be offset-homo-morphic when for each pair of overloadings the coercion function realises a homomorphism of types and at the same time certain conditions on the operator type signature are satisfied. We demonstrate that offset-homomorphic overloading has sufficient power for supporting a comprehensive set of array operations in a declarative language. The problem of inferring the least types in our type system is proven to be equivalent to the shortest path problem for weighted, directed graphs with non-negative cycle weights, which has a computationally efficient solution.