half_check
nanofil also half check
half_checkBound, Lo, Hi, Rights, Align of [Q1, P] is exactly a check of [Lo, Hi) at P that natively tests only one bound, upper or lower; the other end is known from Q1's earlier check of the same object, P being at a known distance from Q1's pointer.
Validator:
ir:half_known/6, its offsets near; Q1 is a renew source. interp.pl:interp:half_bound/6is the native test andinterp:half_res/4the result; where the native test disagrees with the whole check the run isuncheckedhalf.Rocq:
half_known,half_bound,half_restranscribe them; Renew.v proveshalf_bound_agreesandhalf_access, and along runsrun_reuse_checked.
The subtlety: a lower half check reads its address signed and fails on any freed object, where the whole check fails only outside the bounds. The two agree only because objects start at or above 0 (address space) and a freed object's bounds are empty (freed_bounds); both were added to the runtime's statements for this proof.
See half.md and rocq.md, Renew and the half check.
Linked from
- Doomed.v: half_not_alias
- ListSum.v: ls_module
- Logic.v: wp_half_check
- Ops.v: half_bound
- Renew.v: half_access
- Renew.v: half_address
- Renew.v: half_bound_agrees
- Renew.v: half_not_unchecked
- Renew.v: renew_source_def
- Runtime.v: address_space
- Runtime.v: objects_fit
- StepRules.v: op_half_check
- StepRules.v: op_half_check_read
- Syntax.v: bound
- Syntax.v: value
- Transport.v: dbound
- Validate.v: checked_inst_rest
- Validate.v: half_known
- Validate.v: renew_source
- address space
- near offset
- pointer distance
- renew source
- reuse
- the guide: 9. Check evidence and the validator: check_reuse.pl, ir.pl