| # lpt = # avol, avol[m1] = mapped(buf0), m1 < # avol, awbuf-inv(avol, buffered(m1)), avol0 ↓ avol[m1, mapped(buf0 + subarray(buf, 0, n))], # buf0 ≤ align↓(# buf0 + n, EB_PAGE_SIZE), n ≤ # buf, # buf0 + n ≤ LEB_SIZE, EB_PAGE_SIZE ≤ # buf0 % EB_PAGE_SIZE + n, ¬ is-aligned(# buf0 + n, EB_PAGE_SIZE) ⊦ ∃ 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, n)) else { choose n1 with n1 ≠ 0 ∧ n1 < n ∧ 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) |
⊦ m ≤ n ↔ (∃ n0. m + n0 = n)
# lpt = # avol, avol[m1] = mapped(buf0), m1 < # avol, awbuf-inv(avol, buffered(m1)), avol0 ↓ avol[m1, mapped(buf0 + subarray(buf, 0, n))], EB_PAGE_SIZE ≤ # buf0 % EB_PAGE_SIZE + n, # buf0 + n ≤ LEB_SIZE, n ≤ # buf, ∃ n0. # buf0 + n0 = align↓(# buf0 + n, EB_PAGE_SIZE) ⊦ ∃ 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, n)) else { choose n1 with n1 ≠ 0 ∧ n1 < n ∧ 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), is-aligned(# buf0 + n, EB_PAGE_SIZE)
Used terms: align↓(# buf0 + n, EB_PAGE_SIZE), # buf0