| # 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 ⊦ ∃ 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), # buf0 ≤ align↓(# buf0 + n, EB_PAGE_SIZE) |
# lpt = # avol, avol[m1] = mapped(buf0), align↓(# buf0 + n, EB_PAGE_SIZE) < # 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, ¬ 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)
Used simplifier rules: ⊦ m < n → n ≠ 0; (s)%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic% ⊦ m ≤ n ↔ ¬ n < m; (ss)