limit
nanofil also check_limit
limitSize of a pointer P0 is an opaque class-l snapshot of P0's capability and its object's bounds; check_limit0, Size, Rights, Align of [P, U] is exactly a check of P, whose bounds are tested natively against the snapshot U rather than the object's header (plus the free flag, and read-only for a write). A hoisted limit makes a loop's bounds test cheap.
Validator:
ir:limit_covers/5asks that U be a single-definition limit of a single-definition P0 and that P reach P0 by a lower chain;ir:limit_reads/2lets nothing but a check_limit read a limit. Validate.v:limit_covers,limit_reads.Values: interp.pl's
limitCap, SizeisWLimitin Values.v. A check_limit whose limit is of another capability isuncheckedlimit(WhyLimit).Guard.v:
lower_chain_soundgives P the limit's capability, so the instruction checks (run_guard_checked).
Why the snapshot is sound: an object's bounds change only when it is freed, which sets the free flag the check also tests.
See bounds.md and rocq.md, Guards and limits.
Linked from
- ExternalCalls.v: word_authority
- Guard.v: check_limit_not_unchecked
- Guard.v: span_test_ok
- Semantics.v: doomed_result
- Single.v: replayable
- Syntax.v: value
- Validate.v: checked_op
- Validate.v: limit_covers
- Validate.v: limit_reads
- Validate.v: op_result_ok
- Validate.v: stage_func
- Validate.v: valid_op
- Values.v: word_at_class
- lower chain
- renew source
- reuse
- the formal campaign: Campaign 5: static discharge by certificate
- the formal campaign: The ambition
- the formal campaign: The campaigns at a glance
- the formal campaign: The claims, kept apart
- the guide: 9. Check evidence and the validator: check_reuse.pl, ir.pl
- trap
- unchecked
- word