| # pebs0 = n + m1, # pebs1 = n + m1, # buf1 = EB_PAGE_SIZE, pebs1[m1] = mkpeb(buf0, m2, false), n ≠ 0, 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 ⊦ [fail_or_success#(; ; err); pebs := pebs1[m1, mkpeb(emptypeb, 0, false)]; if err = ESUCCESS then {pebs[m1].data := copy(buf1, 0, pebs[m1].data, 0, EB_PAGE_SIZE); pebs[m1].fill := EB_PAGE_SIZE} else {n1 := 0; 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)) |
# buf1 = EB_PAGE_SIZE, # pebs1 = n + m1, # pebs0 = n + m1, pebs1[m1] = mkpeb(buf0, m2, false), 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 ⊦ [choose err0 with ⌊err0⌋ ∨ err0 = ESUCCESS in err := err0; pebs := pebs1[m1, mkpeb(emptypeb, 0, false)]; if err = ESUCCESS then {pebs[m1].data := copy(buf1, 0, pebs[m1].data, 0, EB_PAGE_SIZE); pebs[m1].fill := EB_PAGE_SIZE} else {n1 := 0; 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)), n = 0
Used simplifier rules: fail_or_success#(; ; ERR) {choose ERR0 with ⌊ERR0⌋ ∨ ERR0 = ESUCCESS in ERR := ERR0};