| # 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), mapped-full?(avol0, n0, n1), range=(avol0, n0 + n2 + n1, avol1, n0 + n2 + n1, n3), range=(avol0, 0, avol1, 0, n0), n0 + n2 + n1 ≤ # avol1 ⊦ ⟪ebm_avol_write#(n0 + n1, 0, n1 * LEB_SIZE, LEB_SIZE, buf; avol; err); n := n1 + 1⟫ ( n ≤ n2 + n1 ∧ ebm-vol-inv(avol) ∧ (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) |
ebm-vol-inv(avol), m < # avol, avol[m].mapped?, # avol[m].data ≤ m0, is-aligned(m0, EB_PAGE_SIZE), is-aligned(n, EB_PAGE_SIZE), m0 + n ≤ LEB_SIZE, n0 + n ≤ # buf ⊦ ⟪ebm_avol_write#(m, m0, n0, n, buf; avol; err)⟫ ebm-vol-inv(avol)
# avol1 = n3 + n0 + n2 + n1, # buf = (n2 + n1) * LEB_SIZE, # avol0 = # avol1, avol = avol0[n0 + n1, mapped(mkbuf(0))], buf0 = buf, lebs(avol0, n0, n1) = subarray(buf, 0, n1 * LEB_SIZE), m1 = n0 + n1, m2 = 0, n4 = LEB_SIZE, n5 = n1 * LEB_SIZE, avol[n0 + n1].mapped?, n0 + n1 < # avol1, n0 + n1 < # avol, ebm-vol-inv(avol0), ebm-vol-inv(avol1), ebm-vol-inv(avol0[n0 + n1, mapped(mkbuf(0))]), ebm-vol-inv(avol), is-aligned(0, EB_PAGE_SIZE), is-aligned(LEB_SIZE, EB_PAGE_SIZE), mapped-full?(avol0, n0, n1), range=(avol0, 0, avol1, 0, n0), range=(avol0, n0 + n2 + n1, avol1, n0 + n2 + n1, n3), n0 + n2 + n1 ≤ # avol1, # avol[n0 + n1].data ≤ 0, 0 + LEB_SIZE ≤ LEB_SIZE, n1 * LEB_SIZE + LEB_SIZE ≤ # buf ⊦ [ebm_avol_write#(n0 + n1, 0, n1 * LEB_SIZE, LEB_SIZE, buf; avol; err)] ( ebm-vol-inv(avol) → ⟪n := n1 + 1⟫ ( n ≤ n2 + n1 ∧ ebm-vol-inv(avol) ∧ (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)), n3 + n2 = 0, n2 = 0
Used simplifier rules: ⊦ # avol[n, aleb] = # avol; (s)% ⊦ m < # avol → avol[m, aleb][m] = aleb; (s)% ⊦ mapped(buf).mapped?; (s)% ⊦ mapped(buf).data = buf; (s)% ⊦ # mkbuf(n) = n; (s)% ⊦ EB_PAGE_SIZE ≠ 0; (s)%n ≠ 0 ⊦ is-aligned(0, n); (s)% ⊦ is-aligned(LEB_SIZE, EB_PAGE_SIZE); (ss)% ⊦ n + 0 = n; (s)%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic%c: ⊦ m + n = n + m; from specification nat-basic% ⊦ m ≤ m; (s)% ⊦ m ≤ n ↔ ¬ n < m; (ss)%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic%lf-02: ⊦ m < n ∧ m = n0 → n0 < n; (forward) from specification nat-basic% ⊦ LEB_SIZE + n ≠ 0; (s)% ⊦ m * n < m1 * n + n ↔ m < m1 + 1 ∧ n ≠ 0; (s)% ⊦ m + n < m + n0 ↔ n < n0; (s)% ⊦ m < 1 ↔ m = 0; (s)%mult-a: ⊦ m0 * m * n = (m0 * m) * n; from specification nat-mult%mult-c: ⊦ m * n = n * m; from specification nat-mult%# buf = n ⊦ subarray(buf, 0, n) = buf; (s)% ⊦ m < n ↔ ¬ n ≤ m; (ss)% ⊦ m < n → (n ≤ m ↔ false); (s)%n + m < # avol ⊦ ebm-vol-inv(avol) → # lebs(avol, n, m) = m * LEB_SIZE; (s)