Table of contents
Reads
Formal definition
Reading is a relation :
holding when accesses an instance to observe its value and persists after completes — available and unchanged.
One invariant. iff:
- Non-destructive access: accesses — observes its value, queries its state, inspects its content — without consuming or modifying . The resource after is identical to before : same value, same availability, same usability by other operations. Idempotency of reading: reading twice leaves in exactly the same state as reading once.
Girard: the exponential !A
Jean-Yves Girard (Linear Logic, 1987, Theoretical Computer Science): in linear logic, the exponential marks a proposition as unrestricted — usable any number of times. An operation reads non-destructively: the modality allows using without consuming it. The same instance of can serve as input to multiple operations simultaneously — shared read access.
The exponential restores contraction ( — copy) and weakening ( — discard) that linear logic otherwise forbids. Reading is the computational interpretation of : resources can be inspected, duplicated, or discarded. Promotion: — if all inputs are unrestricted (read-only), the output is also unrestricted.
Separation logic: fractional permissions
Boyland (2003) and Bornat, Calcagno, O’Hearn, Parkinson (2005) introduced fractional permissions for . Full ownership () allows reads and writes; fractional ownership () allows only reads.
Multiple threads can hold fractional read permissions simultaneously: is satisfiable when . The read rule: — the read returns the value and leaves the permission unchanged. Reading is formally non-consumptive: the permission is not reduced by reading.
Effect type systems
Lucassen and Gifford (Polymorphic Effect Systems, 1988): an operation type reads from region but performs no writes. Read-only functions are observationally pure with respect to writes: calling from the same state produces the same result (assuming no concurrent writes by others).
Benton and Wadler: the LNL comonad
Nick Benton and Philip Wadler (Linear Logic, Monads and the Lambda Calculus, LICS 1996) construct the Linear/Non-Linear (LNL) model that makes the comonad structure of precise:
A monoidal adjunction between a cartesian closed category (classical types, with weakening and contraction) and a symmetric monoidal closed category (linear types) induces a comonad on . The comonad is exactly the linear logic modality. The counit is dereliction — extracting the value from a reusable resource. The comultiplication is contraction on the comonadic level.
Reading corresponds to the counit: an operation that reads has type — it applies to extract the value, uses it, and returns the resource unchanged (re-introduces it via the comonad structure). The comonad enforces that reading is non-destructive: the resource is threaded through the reading operation via the comonad’s extract-and-return discipline.
The induced monad on gives the computational monad for effects. Reading corresponds to the state monad’s read operation: where the state is returned alongside the read value — the state is not destroyed.
Atkey: quantitative type theory
Robert Atkey (Syntax and Semantics of Quantitative Type Theory, LICS 2018) provides a unified framework for all resource operation modes. Each variable in the context is annotated with a usage multiplicity drawn from a semiring:
\0 \text{ (not accessed)}, \quad 1 \text{ (used exactly once)}, \quad \omega \text{ (used any number of times)}$$
These are the three grades of the usage semiring (with $0 + 1 = 1, \1 + 1 = \omega, \1 \cdot 1 = 1\omega \cdot 1 = \omegax :_\rho AxA\rho$. The resource operations are then:
| Grade | Access mode | Corresponds to |
|---|---|---|
| Not accessed (may be absent) | Weakening — unused parameter | |
| Used exactly once | Consumes — linear use | |
| Used freely, any number of times | Reads — non-destructive access |
Reading is exactly : the resource may be accessed arbitrarily many times (zero, one, or more) without being consumed. This is the formal content of idempotency-of-reading: the resource with grade may be inspected times for any and remains available.
The semiring structure ensures the accounting is consistent: using a grade- resource once leaves grade (not ); using a grade-$1 resource once leaves grade \0$ (consumed).
Open questions
- Whether in linear logic and fractional read permissions in separation logic are formally the same — whether there is a translation from the proof nets of multiplicative-exponential linear logic to separation logic entailments that maps to fractional permissions, and whether the LNL comonad structure corresponds to the permission-splitting operations in fractional permission models.
- Whether reading has a coherent account under quantum uncertainty — where measurement collapses a quantum state — and whether classical reading is the limit of quantum measurement as decoherence goes to infinity.
- Whether the grade- account of reads (Atkey) and the fractional-permission account (Boyland, Bornat et al.) are formally equivalent — whether corresponds to the condition for fractional , and whether the fractional value encodes the “number of simultaneous readers” in some precise sense.