Another Type System for In-Place Update

  • Authors:
  • David Aspinall;Martin Hofmann

  • Affiliations:
  • -;-

  • Venue:
  • ESOP '02 Proceedings of the 11th European Symposium on Programming Languages and Systems
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

Linear typing schemes guarantee single-threadedness and so the soundness of in-place update with respect to a functional semantics. But linear schemes are restrictive in practice, and more restrictive than necessary to guarantee soundness of in-place update. This has prompted research into static analysis and more sophisticated typing disciplines, to determine when in-place update may be safely used, or to combine linear and non-linear schemes. Here we contribute to this line of research by defining a new typing scheme which better approximates the semantic property of soundness of in-place update for a functional semantics. Our typing scheme includes two kinds of products (驴 and 脳), which allows data structures with or without sharing to be defined. We begin from the observation that some data is used only in a "read-only" context after which it may be safely re-used before being destroyed. Formalizing the in-place update interpretation and giving a machine model semantics allows us to refine this observation. We define three usage aspects apparent from the semantics, which are used to annotate function argument types. The aspects are (1) used destructively, (2) used read-only but shared with result, and (3) used read-only and not shared.