Hostname: page-component-77f85d65b8-zzw9c Total loading time: 0 Render date: 2026-03-27T13:26:11.064Z Has data issue: false hasContentIssue false

A type system with usage aspects

Published online by Cambridge University Press:  01 March 2008

DAVID ASPINALL
Affiliation:
LFCS Edinburgh, Mayfield Rd, Edinburgh EH9 3JZ, UK (e-mail: David.Aspinall@ed.ac.uk) http://homepages.inf.ed.ac.uk/da/
MARTIN HOFMANN
Affiliation:
Institut für Informatik, Oettingenstraβe 67, 80538 München, Germany (e-mail: mhofmann@informatik.uni-muenchen.de) http://www.tcs.informatik.uni-muenchen.de~mhofmann/
MICHAL KONEČNÝ
Affiliation:
Aston University, Aston Triangle, Birmingham, B4 7ET, UK (e-mail: m.konecny@aston.ac.uk) http://www.aston.ac.uk~konecnym/
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Linear typing schemes can be used to guarantee non-interference 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 limitation 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 direction by defining a new typing scheme that better approximates the semantic property of soundness of in-place update for a functional semantics. We begin from the observation that some data are used only in a “read-only” context, after which it may be safely re-used before being destroyed. Formalising the in-place update interpretation in a machine model semantics allows us to refine this observation, motivating three usage aspects apparent from the semantics that 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 with the result. The main novelty is aspect (2), which allows a linear value to be safely read and even aliased with a result of a function without being consumed. This novelty makes our type system more expressive than previous systems for functional languages in the literature. The system remains simple and intuitive, but it enjoys a strong soundness property whose proof is non-trivial. Moreover, our analysis features principal types and feasible type reconstruction, as shown in M. Konečn'y (In TYPES 2002 workshop, Nijmegen, Proceedings, Springer-Verlag, 2003).

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2007
Submit a response

Discussions

No Discussions have been published for this article.