Weak-Linear Types
Hector Gramaglia
TL;DR
This paper addresses the rigidity of linear types for practical programming by introducing weak-linear types, which permit read-only access to linear data through a new $\mathsf{hi}$ qualifier while preserving the simplicity of Walker's linear framework. It defines a linear applicative language with a qualified signature $\Sigma^\mathsf{q}$ and uses two forms of context splitting (regular and pseudosplit) to manage memory and typing, complemented by a store-based small-step semantics and an explicit (shi) rule for hidden data. The authors prove preservation and progress and demonstrate memory efficiency gains via benchmarks such as fib, map, mapa, and sort, highlighting both the benefits and limits of weak-linearity. The work contributes a clean theoretical model for substructural reasoning and in-place updates, with potential for guiding memory-management strategies in systems that rely on linear or substructural type disciplines.
Abstract
Computational interpretations of linear logic allow static control of memory resources: the data produced by the program are endowed through its type with attributes that determine its life cycle, and guarantee safe deallocation. The use of linear types encounters limitations in practice, since linear data, in the traditional sense, do not so often appear in actual programs. Several alternatives have been proposed in the attempt to relax the condition of linearity, adding coercions to the language to allow linear objects to be temporarily aliased. In this work we propose a new alternative, whose virtue is to preserve the simplicity and elegance of the original system.
