| # pebs0 = n + m1, # pebs1 = n + m1, # buf1 = EB_PAGE_SIZE, pebs1[m1] = mkpeb(buf0, m2, false), err = err0, n1 = 0, pebs = pebs1[m1, mkpeb(emptypeb, 0, false)], m1 < # pebs1, is-encoded(echdr((err1 = ESUCCESS ∧ aehdr0.valid? ⊃ aehdr0.ec + 1;0)), buf1), mtd-cons(pebs0), mtd-cons(pebs1), mtd-cons(pebs1[m1, mkpeb(emptypeb, 0, false)]), ubi-io-initial(subarray(pebs1, 0, m1)), EB_PAGE_SIZE ≤ PEB_SIZE, ⌊err0⌋ ∨ err0 = ESUCCESS ⊦ [n0 := EB_PAGE_SIZE; m0 := m1; m := 0; choose n with (n < n0 ∨ n = 0 ∧ n0 = 0) ∧ is-aligned(n, EB_PAGE_SIZE) in if n ≠ 0 then {pebs[m0].data := copy(buf1, n1, pebs[m0].data, m, n); pebs[m0].fill := m + n}] ( mtd-cons(pebs) → ⟪m1 := m1 + 1⟫ ( m1 ≤ # pebs0 ∧ # pebs0 = # pebs ∧ (err = ESUCCESS → ubi-io-initial(subarray(pebs, 0, m1))) ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # pebs0 < n + m1)), err = ESUCCESS, n = 0 |
# buf1 = EB_PAGE_SIZE, # pebs1 = n + m1, # pebs0 = n + m1, pebs1[m1] = mkpeb(buf0, m2, false), err = err0, n0 = EB_PAGE_SIZE, n1 = 0, pebs = pebs1[m1, mkpeb(emptypeb, 0, false)], m1 < # pebs1, is-encoded(echdr((err1 = ESUCCESS ∧ aehdr0.valid? ⊃ aehdr0.ec + 1;0)), buf1), mtd-cons(pebs1[m1, mkpeb(emptypeb, 0, false)]), mtd-cons(pebs1), mtd-cons(pebs0), ubi-io-initial(subarray(pebs1, 0, m1)), EB_PAGE_SIZE ≤ PEB_SIZE, ⌊err0⌋ ∨ err0 = ESUCCESS ⊦ [m0 := m1; m := 0; choose n with (n < n0 ∨ n = 0 ∧ n0 = 0) ∧ is-aligned(n, EB_PAGE_SIZE) in if n ≠ 0 then {pebs[m0].data := copy(buf1, n1, pebs[m0].data, m, n); pebs[m0].fill := m + n}] ( mtd-cons(pebs) → ⟪m1 := m1 + 1⟫ ( m1 ≤ # pebs0 ∧ # pebs0 = # pebs ∧ (err = ESUCCESS → ubi-io-initial(subarray(pebs, 0, m1))) ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # pebs0 < n + m1)), err = ESUCCESS, n = 0