Types, potency, and idempotency: why nonlinearity and amnesia make a type system work

  • Authors:
  • Peter Møller Neergaard;Harry G. Mairson

  • Affiliations:
  • Brandeis University, Waltham, MA;Brandeis University, Waltham, MA

  • Venue:
  • Proceedings of the ninth ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Useful type inference must be faster than normalization. Otherwise, you could check safety conditions by running the program. We analyze the relationship between bounds on normalization and type inference. We show how the success of type inference is fundamentally related to the amnesia of the type system: the nonlinearity by which all instances of a variable are constrained to have the same type.Recent work on intersection types has advocated their usefulness for static analysis and modular compilation. We analyze System-I (and some instances of its descendant, System E), an intersection type system with a type inference algorithm. Because System-I lacks idempotency, each occurrence of a variable requires a distinct type. Consequently, type inference is equivalent to normalization in every single case, and time bounds on type inference and normalization are identical. Similar relationships hold for other intersection type systems without idempotency.The analysis is founded on an investigation of the relationship between linear logic and intersection types. We show a lockstep correspondence between normalization and type inference. The latter shows the promise of intersection types to facilitate static analyses of varied granularity, but also belies an immense challenge: to add amnesia to such analysis without losing all of its benefits.