rfc: specify closed contract proof and report rules
This commit is contained in:
1 parent
a4181f2d8d
commit
8260d3521e
8 files changed
+185
-4
No files matched your search
@@ -29,7 +29,7 @@ The claim is: every exposed checked value/shared content view satisfies its pred
|
||||
| `checked.take %c` | checked<R,@p> → R; consume linear capsule, copy Copy content | output is ordinary R with no invariant claim; live views block consuming the root |
|
||||
| `checked.modify %m, @f(args)` | mut<checked<R,@p>>; direct callback f receives a temporary lent mut<R> first, then ordinary typed arguments | suspend capsule access, call f, end its temporary mutation view, run p on the resulting R, then expose f's result |
|
||||
|
||||
`make` needs an explicit new instruction-internal place for the complete R candidate, including Copy SSA values. Its predicate receives a dependent `ref<R>` to that place, preserving R itself rather than unwrapping an owner root. The view and every child end before exposure of the result and cannot escape through bool. This adds no general AIR/source addressability for Copy SSA or partially initialized/linear frame locals. Use bounded activation storage, no program heap allocation; exact accounting and interaction with pending-result/local-frame budgets require integration. Existing `borrow.ref` on a Copy scalar or Copy struct SSA root rejects E1001; both baseline cases were independently verified. Their attempted `borrow.end` adds a dependent second E1001 because the invalid result has placeholder type void.
|
||||
`make` needs an explicit new instruction-internal place for a complete Copy R candidate. Linear R is observed in its existing SSA cell, with no copy, move during validation or new frame local; only success transfers it into the capsule. Its predicate receives a dependent `ref<R>` preserving R itself rather than unwrapping an owner root. The view and every child end before exposure of the result and cannot escape through bool. This adds no general AIR/source addressability for Copy SSA or partially initialized/linear frame locals. The [accounting candidate](contract-accounting-and-status.md) charges size(R) only for the Copy place and retains pending results as SSA; use bounded activation storage, no program heap allocation. Existing `borrow.ref` on a Copy scalar or Copy struct SSA root rejects E1001; both baseline cases were independently verified. Their attempted `borrow.end` adds a dependent second E1001 because the invalid result has placeholder type void.
|
||||
|
||||
These are proposed operation contracts, not syntax sugar for optional assertions. Ordinary operations cannot project mutable R from a checked value. Interior changes through shared atomic/mutex/endpoint/arc interfaces do not affect the claim because their mutable observations are outside S below. Whole-value store/exchange replaces it with another checked value. Existing `local.alloc`, owners, regions, arrays, buffers, graph storage, channels and mutexes must transport the complete new type under their existing content restrictions; no field write can manufacture it from R. Nested checked values remain checked when an enclosing representation is extracted. A Copy `take` leaves the capsule and its claim intact, while its plain R copy carries no claim.
|
||||
|
||||
|
||||
Reference in new issue
Block a user