| # lpt = # avol, avol[m1] = mapped(buf0), err0 = err2, n < # buf, m1 < # avol, n < n2, awbuf-inv(avol, buffered(m1)), is-aligned(# buf0 + n, EB_PAGE_SIZE), avol0 ↓ avol[m1, mapped(buf0 + subarray(buf, 0, n))], n2 ≤ # buf, # buf0 + n2 ≤ LEB_SIZE, EB_PAGE_SIZE ≤ # buf0 % EB_PAGE_SIZE + n, ⌊err0⌋ ∨ err0 = ESUCCESS ⊦ ∃ err0. (⌊err0⌋ ∨ err0 = ESUCCESS) ∧ ⟨err := err0; let m = buffered(m1).leb in if err = ESUCCESS then avol[m] := mapped(avol[m].data + subarray(buf, 0, n2)) else { choose n1 with n1 ≠ 0 ∧ n1 < n2 ∧ is-aligned(# avol[m].data + n1, EB_PAGE_SIZE) in avol[m] := mapped(avol[m].data + subarray(buf, 0, n1)) ifnone skip or skip; isbuf := true}⟩ (synced(avol) ∧ avol0 ↓ avol), err2 = ESUCCESS, n = 0 |
# lpt = # avol, avol[m1] = mapped(buf0), n ≠ 0, n < n2, m1 < # avol, n < # buf, awbuf-inv(avol, buffered(m1)), is-aligned(# buf0 + n, EB_PAGE_SIZE), avol0 ↓ avol[m1, mapped(buf0 + subarray(buf, 0, n))], EB_PAGE_SIZE ≤ # buf0 % EB_PAGE_SIZE + n, # buf0 + n2 ≤ LEB_SIZE, n2 ≤ # buf, ⌊err2⌋ ⊦ ∃ err0. (⌊err0⌋ ∨ err0 = ESUCCESS) ∧ ⟨err := err0; let m = buffered(m1).leb in if err = ESUCCESS then avol[m] := mapped(avol[m].data + subarray(buf, 0, n2)) else { choose n1 with n1 ≠ 0 ∧ n1 < n2 ∧ is-aligned(# avol[m].data + n1, EB_PAGE_SIZE) in avol[m] := mapped(avol[m].data + subarray(buf, 0, n1)) ifnone skip or skip; isbuf := true}⟩ (synced(avol) ∧ avol0 ↓ avol)
Used simplifier rules: ⊦ ⌊err⌋ → err ≠ ESUCCESS; (s)