| # buf = m2 * LEB_SIZE, avol0 = avol, err = ESUCCESS, m = LEB_SIZE, m0 = m2, m1 = n0, n = 0, ebm-vol-inv(avol), n0 + m2 ≤ # avol ⊦ ⟪while err = ESUCCESS ∧ n < m0 do {/* (prepost-write-lebs : invariant n ≤ m0 ∧ ebm-vol-inv(avol) ∧ # buf = m0 * LEB_SIZE ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # avol = # avol` ∧ range=(avol, 0, avol`, 0, m1) ∧ range=(avol, m1 + m0, avol`, m1 + m0, # avol` - m1 + m0) ∧ (err = ESUCCESS → lebs(avol, m1, n) = subarray(buf, 0, n * LEB_SIZE) ∧ mapped-full?(avol, m1, n)) wfbound m0 - n) */; ebm_avol_remap#(m1 + n; avol; err); if err = ESUCCESS then ebm_avol_write#(m1 + n, 0, n * m, m, buf; avol; err); n := n + 1}⟫ ( (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # avol = # avol0 ∧ ebm-vol-inv(avol) ∧ range=(avol, 0, avol0, 0, n0) ∧ range=(avol, n0 + m2, avol0, n0 + m2, # avol - n0 + m2) ∧ (err = ESUCCESS → lebs(avol, n0, m2) = buf ∧ mapped-full?(avol, n0, m2))) |
# buf = m2 * LEB_SIZE, # buf = m0 * LEB_SIZE, # avol = # avol1, avol0 = avol1, err = ESUCCESS, err0 = ESUCCESS, m = LEB_SIZE, m0 = m2, m1 = n0, n = n1, n2 = 0, n < m0, ebm-vol-inv(avol1), ebm-vol-inv(avol), range=(avol, 0, avol1, 0, m1), range=(avol, m1 + m0, avol1, m1 + m0, # avol1 - m1 + m0), n0 + m2 ≤ # avol1, n ≤ m0, err = ESUCCESS → lebs(avol, m1, n) = subarray(buf, 0, n * LEB_SIZE) ∧ mapped-full?(avol, m1, n), err = ESUCCESS ∨ ⌊err⌋ ⊦ ⟪ebm_avol_remap#(m1 + n; avol; err); if err = ESUCCESS then ebm_avol_write#(m1 + n, 0, n * m, m, buf; avol; err); n := n + 1⟫ ( ( n ≤ m0 ∧ ebm-vol-inv(avol) ∧ # buf = m0 * LEB_SIZE ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # avol = # avol1 ∧ range=(avol, 0, avol1, 0, m1) ∧ range=(avol, m1 + m0, avol1, m1 + m0, # avol1 - m1 + m0) ∧ (err = ESUCCESS → lebs(avol, m1, n) = subarray(buf, 0, n * LEB_SIZE) ∧ mapped-full?(avol, m1, n))) ∧ m0 - n < m0 - n1)
Used simplifier rules: ⊦ m * n = m * n0 ↔ m = 0 ∨ n = n0; (ws)% ⊦ LEB_SIZE ≠ 0; (s)%mult-a: ⊦ m0 * m * n = (m0 * m) * n; from specification nat-mult%mult-c: ⊦ m * n = n * m; from specification nat-mult% ⊦ m ≠ n → (m ≤ n ↔ m < n); (s)% ⊦ n ≠ n0 → (n < n0 ↔ ¬ n0 < n); (ss)% ⊦ m < n → ¬ n < m; (s)%# buf = n ⊦ subarray(buf, 0, n) = buf; (s)% ⊦ m < n ↔ ¬ n ≤ m; (ss)% ⊦ m ≤ n → (n ≤ m ↔ m = n); (s)% ⊦ m ≤ m; (s)% ⊦ 0 ≤ m; (s)% ⊦ range=(avol, n, avol, n, m) ↔ n + m ≤ # avol; (s)% ⊦ 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 ≤ n ↔ ¬ n < m; (ss)% ⊦ m ≤ n → (n < m ↔ false); (s)%n ≤ m ⊦ (m - n) + m0 ≤ n0 ↔ m + m0 ≤ n0 + n; (s)% ⊦ m + n ≤ m + n0 ↔ n ≤ n0; (s)% ⊦ lebs(avol, n, 0) = mkbuf(0); (s)% ⊦ 0 * n = 0; (s)% ⊦ subarray(buf, n, 0) = mkbuf(0); (s)% ⊦ mapped-full?(avol, m, 0); (s)%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic%fle-01: ⊦ m ≤ n ∧ n < n0 → m < n0; (forward) from specification nat% ⊦ m < n → n ≠ 0; (s)% ⊦ ¬ m + n < m; (s) Used formulas: n ≤ m0 ∧ ebm-vol-inv(avol) ∧ # buf = m0 * LEB_SIZE ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # avol = # avol` ∧ range=(avol, 0, avol`, 0, m1) ∧ range=(avol, m1 + m0, avol`, m1 + m0, # avol` - m1 + m0) ∧ ( err = ESUCCESS → lebs(avol, m1, n) = subarray(buf, 0, n * LEB_SIZE) ∧ mapped-full?(avol, m1, n)), m0 - n = m0 - n