File size: 1,461 Bytes
4951e76
 
 
 
 
 
 
1
2
3
4
5
6
7
8
{"item_id": "ker-bytes_reserve", "crate_dir": "../../bench/kernels/bytes_reserve/pre", "lib_name": "k_bytes_reserve_pre", "provenance": {"author": "claude-sonnet subagent, blind", "written_from": "signature + doc string only", "saw_source": false, "saw_diff": false, "saw_advisory": false},
 "properties": [
  {"id": "p1", "fn": "reserve_fits", "args": [["v_capacity", "usize"], ["new_cap", "usize"], ["offset", "usize"]], "pre": "true", "post": "r == ((v_capacity as u128) >= (new_cap as u128) + (offset as u128))", "ret": "bool", "basis": "true iff v_capacity >= new_cap + offset in exact arithmetic"},
  {"id": "p2", "fn": "reserve_fits", "args": [["v_capacity", "usize"], ["new_cap", "usize"], ["offset", "usize"]], "pre": "true", "post": "new_cap.checked_add(offset).is_some() || !r", "ret": "bool", "basis": "exact arithmetic: if new_cap + offset overflows usize it exceeds any capacity, so false"},
  {"id": "p3", "fn": "reserve_fits", "args": [["v_capacity", "usize"], ["new_cap", "usize"], ["offset", "usize"]], "pre": "true", "post": "offset != 0 || r == (v_capacity >= new_cap)", "ret": "bool", "basis": "with offset 0 the condition reduces to v_capacity >= new_cap"},
  {"id": "p4", "fn": "reserve_fits", "args": [["v_capacity", "usize"], ["new_cap", "usize"], ["offset", "usize"]], "pre": "true", "post": "!(v_capacity == new_cap && offset > 0) || !r", "ret": "bool", "basis": "capacity exactly new_cap with a positive offset is insufficient"}
 ]}