| # pebs1 = n0 + m1, # pebs0 = n0 + m1, pebs1[m1] = mkpeb(buf0, m2, false), buf = mkbuf(EB_PAGE_SIZE), n0 ≠ 0, mtd-cons(pebs1[m1, mkpeb(emptypeb, 0, false)]), mtd-cons(pebs1), mtd-cons(pebs0), ubi-io-initial(subarray(pebs1, 0, m1)) ⊦ [encode_echeader#(EB_PAGE_SIZE, echdr(aechdr((err1 = ESUCCESS ∧ aehdr0.valid? ⊃ aehdr0.ec + 1;0)).ec); buf; err)] ( (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # buf = EB_PAGE_SIZE ∧ (err = ESUCCESS → is-encoded(echdr((err1 = ESUCCESS ∧ aehdr0.valid? ⊃ aehdr0.ec + 1;0)), buf)) → ⟪pebs := pebs1[m1, mkpeb(emptypeb, 0, false)]; if err = ESUCCESS then mtd_asm_write#(m1, 0, 0, EB_PAGE_SIZE, buf; 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)) |
# pebs0 = n0 + m1, # pebs1 = n0 + m1, pebs1[m1] = mkpeb(buf0, m2, false), buf = mkbuf(EB_PAGE_SIZE), mtd-cons(pebs0), mtd-cons(pebs1), mtd-cons(pebs1[m1, mkpeb(emptypeb, 0, false)]), ubi-io-initial(subarray(pebs1, 0, m1)) ⊦ ∀ buf, err. (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # buf = EB_PAGE_SIZE ∧ (err = ESUCCESS → is-encoded(echdr((err1 = ESUCCESS ∧ aehdr0.valid? ⊃ aehdr0.ec + 1;0)), buf)) → ⟪pebs := pebs1[m1, mkpeb(emptypeb, 0, false)]; if err = ESUCCESS then mtd_asm_write#(m1, 0, 0, EB_PAGE_SIZE, buf; 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), n0 = 0