| # avol = # lpt, isbuf ↔ boolvar, avol0 = avol, bleb = nobuffer, keyset(gch) = gc-heap(lpt, []), lpt0 = lpt1, lpt2 = lpt, m = m0, awbuf-inv(avol, nobuffer), bin-heap-inv(gch, lpt), freelist-cons(lpt, freelist), synced(avol) ⊦ ⟪let n = 0 in while n < # lpt do {/* (prepost-cleanup-lpt : invariant n ≤ # lpt ∧ # lpt = # lpt` ∧ id-idx(cleanup-lpt(lpt`, n), lpt) ∧ awbuf-inv(avol, bleb) ∧ avol-cleanup-lpt-unchanged(avol`, avol, lpt`) ∧ freelist-cons(lpt, freelist) ∧ keyset(gch) = gc-heap(cleanup-lpt(lpt`, n), []) ∧ bin-heap-inv(gch, lpt) ∧ bleb = nobuffer ∧ synced(avol) wfbound # lpt - n) */; if lpt[n].ref-size = 0 ∧ lpt[n].flags ≠ LP_FREE then {if lpt[n].flags = LP_GROUP_NODES then gc_heap_remove#(lpt[n].gcheapidx; gch, lpt); lpt[n].flags := LP_FREE; lpt[n].size := 0; freelist := freelist + n; awbuf_unmap#(n, adr, m, log, lpt0, ns, bleb, isbuf; avol)}; n := n + 1}⟫ ( id-idx(cleanup-lpt(lpt2), lpt) ∧ avol-cleanup-lpt-unchanged(avol0, avol, lpt2) ∧ freelist-cons(cleanup-lpt(lpt2), freelist) ∧ awbuf-inv(avol, nobuffer) ∧ bin-heap-inv(gch, lpt) ∧ keyset(gch) = gc-heap(cleanup-lpt(lpt2), [])) |
# avol = # lpt, isbuf ↔ boolvar, avol0 = avol, bleb = nobuffer, keyset(gch) = gc-heap(lpt, []), lpt0 = lpt1, lpt2 = lpt, m = m0, n = 0, awbuf-inv(avol, nobuffer), bin-heap-inv(gch, lpt), freelist-cons(lpt, freelist), synced(avol) ⊦ ⟪while n < # lpt do {/* (prepost-cleanup-lpt : invariant n ≤ # lpt ∧ # lpt = # lpt` ∧ id-idx(cleanup-lpt(lpt`, n), lpt) ∧ awbuf-inv(avol, bleb) ∧ avol-cleanup-lpt-unchanged(avol`, avol, lpt`) ∧ freelist-cons(lpt, freelist) ∧ keyset(gch) = gc-heap(cleanup-lpt(lpt`, n), []) ∧ bin-heap-inv(gch, lpt) ∧ bleb = nobuffer ∧ synced(avol) wfbound # lpt - n) */; if lpt[n].ref-size = 0 ∧ lpt[n].flags ≠ LP_FREE then {if lpt[n].flags = LP_GROUP_NODES then gc_heap_remove#(lpt[n].gcheapidx; gch, lpt); lpt[n].flags := LP_FREE; lpt[n].size := 0; freelist := freelist + n; awbuf_unmap#(n, adr, m, log, lpt0, ns, bleb, isbuf; avol)}; n := n + 1}⟫ ( id-idx(cleanup-lpt(lpt2), lpt) ∧ avol-cleanup-lpt-unchanged(avol0, avol, lpt2) ∧ freelist-cons(cleanup-lpt(lpt2), freelist) ∧ awbuf-inv(avol, nobuffer) ∧ bin-heap-inv(gch, lpt) ∧ keyset(gch) = gc-heap(cleanup-lpt(lpt2), []))