| # avol0 = # avol1, # buf = (n2 + n1) * LEB_SIZE, # avol1 = n3 + n0 + n2 + n1, avol = avol0[n0 + n1, mapped(mkbuf(0))], lebs(avol0, n0, n1) = subarray(buf, 0, n1 * LEB_SIZE), n3 + n2 ≠ 0, n2 ≠ 0, n0 + n1 < # avol1, ebm-vol-inv(avol0[n0 + n1, mapped(mkbuf(0))]), ebm-vol-inv(avol1), ebm-vol-inv(avol0), is-aligned(LEB_SIZE, EB_PAGE_SIZE), mapped-full?(avol0, n0, n1), range=(avol0, n0 + n2 + n1, avol1, n0 + n2 + n1, n3), range=(avol0, 0, avol1, 0, n0), n1 * LEB_SIZE + LEB_SIZE ≤ # buf, n0 + n2 + n1 ≤ # avol1 ⊦ [ebm_avol_write#(n0 + n1, 0, n1 * LEB_SIZE, LEB_SIZE, buf; avol; err)] ( ebm-vol-inv(avol) → ⟪n := n1 + 1⟫ ( n ≤ n2 + n1 ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # avol = # avol1 ∧ range=(avol, 0, avol1, 0, n0) ∧ range=(avol, n0 + n2 + n1, avol1, n0 + n2 + n1, n3) ∧ (err = ESUCCESS → lebs(avol, n0, n) = subarray(buf, 0, n * LEB_SIZE) ∧ mapped-full?(avol, n0, n)) ∧ n1 < n)) |
# avol1 = n3 + n5 + n2 + n4, # buf = (n2 + n4) * LEB_SIZE, # avol0 = # avol1, avol = avol0[n5 + n4, mapped(mkbuf(0))], lebs(avol0, n5, n4) = subarray(buf, 0, n4 * LEB_SIZE), m = 0, m0 = n5 + n4, n0 = LEB_SIZE, n1 = n4 * LEB_SIZE, n5 + n4 < # avol1, ebm-vol-inv(avol0), ebm-vol-inv(avol1), ebm-vol-inv(avol0[n5 + n4, mapped(mkbuf(0))]), is-aligned(LEB_SIZE, EB_PAGE_SIZE), mapped-full?(avol0, n5, n4), range=(avol0, 0, avol1, 0, n5), range=(avol0, n5 + n2 + n4, avol1, n5 + n2 + n4, n3), n5 + n2 + n4 ≤ # avol1, n4 * LEB_SIZE + LEB_SIZE ≤ # buf ⊦ [if m0 < # avol ∧ avol[m0].mapped? ∧ # avol[m0].data ≤ m ∧ is-aligned(m, EB_PAGE_SIZE) ∧ is-aligned(n0, EB_PAGE_SIZE) ∧ m + n0 ≤ LEB_SIZE ∧ n1 + n0 ≤ # buf then {fail_or_success#(; ; err); if err = ESUCCESS then if n0 ≠ 0 then avol[m0] := mapped(avol[m0].data + mkempbuf(m - # avol[m0].data) + subarray(buf, n1, n0)) else choose n with n < n0 ∧ is-aligned(n, EB_PAGE_SIZE) in if n ≠ 0 then avol[m0] := mapped(avol[m0].data + mkempbuf(m - # avol[m0].data) + subarray(buf, n1, n)) ifnone skip} else abort] ( ebm-vol-inv(avol) → ⟪n := n4 + 1⟫ ( n ≤ n2 + n4 ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # avol = # avol1 ∧ range=(avol, 0, avol1, 0, n5) ∧ range=(avol, n5 + n2 + n4, avol1, n5 + n2 + n4, n3) ∧ (err = ESUCCESS → lebs(avol, n5, n) = subarray(buf, 0, n * LEB_SIZE) ∧ mapped-full?(avol, n5, n)) ∧ n4 < n)), n3 + n2 = 0, n2 = 0
Used simplifier rules: ebm_avol_write#(LNUM, OFFSET, N0, N, BUF; AVOL; ERR) {if LNUM < # AVOL ∧ AVOL[LNUM].mapped? ∧ # AVOL[LNUM].data ≤ OFFSET ∧ is-aligned(OFFSET, EB_PAGE_SIZE) ∧ is-aligned(N, EB_PAGE_SIZE) ∧ OFFSET + N ≤ LEB_SIZE ∧ N0 + N ≤ # BUF then {fail_or_success#(; ; ERR); if ERR = ESUCCESS then if N ≠ 0 then AVOL[LNUM] := mapped ( AVOL[LNUM].data + mkempbuf(OFFSET - # AVOL[LNUM].data) + subarray(BUF, N0, N)) else choose N1 with N1 < N ∧ is-aligned(N1, EB_PAGE_SIZE) in if N1 ≠ 0 then AVOL[LNUM] := mapped ( AVOL[LNUM].data + mkempbuf(OFFSET - # AVOL[LNUM].data) + subarray(BUF, N0, N1)) ifnone skip} else abort };