| # avol1 = n3 + n0 + n2 + n1, # buf = (n2 + n1) * LEB_SIZE, # avol = # avol1, lebs(avol, n0, n1) = subarray(buf, 0, n1 * LEB_SIZE), n2 ≠ 0, ebm-vol-inv(avol1), ebm-vol-inv(avol), mapped-full?(avol, n0, n1), range=(avol, 0, avol1, 0, n0), range=(avol, n0 + n2 + n1, avol1, n0 + n2 + n1, n3), n0 + n2 + n1 ≤ # avol1 ⊦ ⟪ebm_avol_remap#(n0 + n1; avol; err); n := n1; if err = ESUCCESS then ebm_avol_write#(n0 + n, 0, n * LEB_SIZE, LEB_SIZE, buf; avol; err); n := n + 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 ⊦ ⟪ebm_avol_remap#(m; avol; err)⟫ ebm-vol-inv(avol)
# avol = # avol1, # buf = (n2 + n1) * LEB_SIZE, # avol1 = n3 + n0 + n2 + n1, lebs(avol, n0, n1) = subarray(buf, 0, n1 * LEB_SIZE), m0 = n0 + n1, n0 + n1 < # avol, ebm-vol-inv(avol1), ebm-vol-inv(avol), mapped-full?(avol, n0, n1), range=(avol, n0 + n2 + n1, avol1, n0 + n2 + n1, n3), range=(avol, 0, avol1, 0, n0), n0 + n2 + n1 ≤ # avol1 ⊦ [ebm_avol_remap#(n0 + n1; avol; err)] ( ebm-vol-inv(avol) → ⟪n := n1; if err = ESUCCESS then ebm_avol_write#(n0 + n, 0, n * LEB_SIZE, LEB_SIZE, buf; avol; err); n := n + 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)), n2 = 0
Used simplifier rules: ⊦ m < n ↔ ¬ n ≤ m; (ss)%let: ⊦ n ≤ n0 ∧ n0 ≤ n1 → n ≤ n1; (forward) from specification nat% ⊦ m + n ≤ m + n0 ↔ n ≤ n0; (s)% ⊦ m + m0 ≤ m ↔ m0 = 0; (s)%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic%c: ⊦ m + n = n + m; from specification nat-basic%# buf = n ⊦ subarray(buf, 0, n) = buf; (s)