update
Syntax
Semantics
update performs a pure functional update on an aggregate value (currently arrays).
- Returns a new value
- Does not mutate
x xremains usable after the update- Produces a fresh SSA value
- Referentially transparent
Formally, for arrays:
Properties
- No aliasing
- No side effects
- Safe under verification
- Composes naturally with SSA
- Deterministic and total (subject to bounds checking)
Example
Notes
updatedoes not consumex- Index bounds are statically checked when possible
- Dynamic bounds are discharged to the SMT solver