span_test
nanofil also span test
span_testLo, Hi of a pointer P0 is 1 when P0's object contains [P0+Lo, P0+Hi), addresses taken modulo 2^64 and compared unsigned, and 0 otherwise, including for a null, function, external or freed capability. It never traps and reaches no safepoint: it is the guard that --checks=guard puts before a loop.
A renew_if of P reads its result G.
ir:guard_covers/5accepts it when G is a single-definition span test of a single-definition P0 and P's guard chain puts P's span inside the tested one. Where G is 0 the renew_if runs the full check out of line.interp.pl evaluates it in
interp:kind_res/8; Validate.v transcribesguard_covers. Guard.v proves the trust sound:span_test_ok,guard_inside,renew_inside, and along runsrun_guard_checked.
The subtlety: the span test reduces its two addresses modulo 2^64 separately, so their difference is the span's width only because the width is below 2^64, which ir:valid_op/1 ensures by bounding Lo and Hi as signed 64-bit offsets.
See rocq.md, Guards and limits and m7.md, round 5.
Linked from
- Guard.v: span_guard_holds
- Guard.v: span_test_ok
- Single.v: replayable
- Syntax.v: value
- Validate.v: checked_op
- Validate.v: guard_covers
- Validate.v: op_result_ok
- Validate.v: valid_op
- evidence
- guard
- renew_if
- the formal campaign: Campaign 0: measure the residual
- the formal campaign: Campaign 5: static discharge by certificate
- the guide: 9. Check evidence and the validator: check_reuse.pl, ir.pl
- the guide: Safepoints and GC roots