| # pebs0 = n0 + m1, # pebs1 = n0 + m1, pebs1[m1] = mkpeb(buf, m0, false), err = err0, err = ESUCCESS, err2 = err, pebs = pebs1[m1, mkpeb(emptypeb, 0, pebs1[m1].bad)], m1 < # pebs1, mtd-cons(pebs), mtd-cons(pebs0), mtd-cons(pebs1), ubi-io-initial(subarray(pebs1, 0, m1)), ⌊err0⌋ ∨ err0 = ESUCCESS ⊦ ⟪ubi_io_write_echdr#(m1, aechdr((err1 = ESUCCESS ∧ aehdr.valid? ⊃ aehdr.ec + 1;0)), EB_PAGE_SIZE; pebs; err2); m1 := m1 + 1⟫ ( m1 ≤ # pebs0 ∧ # pebs0 = # pebs ∧ mtd-cons(pebs) ∧ (err2 = ESUCCESS → ubi-io-initial(subarray(pebs, 0, m1))) ∧ (err2 = ESUCCESS ∨ ⌊err2⌋ ) ∧ # pebs0 < n0 + m1), n0 = 0 |
# pebs1 = n0 + m1, # pebs0 = n0 + m1, pebs1[m1] = mkpeb(buf, m0, false), pebs = pebs1[m1, mkpeb(emptypeb, 0, false)], n0 ≠ 0, mtd-cons(pebs1[m1, mkpeb(emptypeb, 0, false)]), mtd-cons(pebs1), mtd-cons(pebs0), ubi-io-initial(subarray(pebs1, 0, m1)) ⊦ ⟪ubi_io_write_echdr#(m1, aechdr((err1 = ESUCCESS ∧ aehdr.valid? ⊃ aehdr.ec + 1;0)), EB_PAGE_SIZE; pebs; err); m1 := m1 + 1⟫ ( m1 ≤ # pebs0 ∧ # pebs0 = # pebs ∧ mtd-cons(pebs) ∧ (err = ESUCCESS → ubi-io-initial(subarray(pebs, 0, m1))) ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # pebs0 < n0 + m1)
Used simplifier rules: c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m < m + n ↔ n ≠ 0; (s)% ⊦ mkpeb(buf, m, boolvar).bad ↔ boolvar; (s)%lf-01: ⊦ m < n ∧ n = n0 → m < n0; (forward) from specification nat-basic% ⊦ ¬ ⌊ESUCCESS⌋ ; (s)