| # buf1 = EB_PAGE_SIZE, # pebs1 = n0 + m1, # pebs0 = n0 + m1, pebs1[m1] = mkpeb(buf0, m2, false), pebs = pebs1[m1, mkpeb(emptypeb, 0, false)], n0 ≠ 0, 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)) ⊦ ⟪mtd_asm_write#(m1, 0, 0, EB_PAGE_SIZE, buf1; 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) |
mtd-cons(pebs), m < # pebs, ¬ pebs[m].bad, pebs[m].fill ≤ m0, m0 + n ≤ PEB_SIZE, n0 + n ≤ # buf, is-aligned(m0, EB_PAGE_SIZE), is-aligned(n, EB_PAGE_SIZE) ⊦ ⟪mtd_asm_write#(m, m0, n0, n, buf; pebs; err)⟫ mtd-cons(pebs)
# pebs0 = n0 + m1, # pebs1 = n0 + m1, # buf1 = EB_PAGE_SIZE, pebs1[m1] = mkpeb(buf0, m2, false), buf2 = buf1, m3 = m1, m4 = 0, n1 = EB_PAGE_SIZE, n2 = 0, pebs = pebs1[m1, mkpeb(emptypeb, 0, false)], m1 < # pebs, is-aligned(0, EB_PAGE_SIZE), is-aligned(EB_PAGE_SIZE, EB_PAGE_SIZE), 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)]), mtd-cons(pebs), ubi-io-initial(subarray(pebs1, 0, m1)), pebs[m1].fill ≤ 0, 0 + EB_PAGE_SIZE ≤ PEB_SIZE, 0 + EB_PAGE_SIZE ≤ # buf1 ⊦ [mtd_asm_write#(m1, 0, 0, EB_PAGE_SIZE, buf1; pebs; err)] ( mtd-cons(pebs) → ⟪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, pebs[m1].bad
Used simplifier rules: ⊦ # pebs[n, peb] = # pebs; (s)% ⊦ m < # pebs → pebs[m, peb][m] = peb; (s)% ⊦ mkpeb(buf, m, boolvar).bad ↔ boolvar; (s)% ⊦ mkpeb(buf, m, boolvar).fill = m; (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% ⊦ EB_PAGE_SIZE ≠ 0; (s)%n ≠ 0 ⊦ is-aligned(0, n); (s)%n ≠ 0 ⊦ is-aligned(n, n); (s)% ⊦ m < m + n ↔ n ≠ 0; (s)% ⊦ m ≤ m; (s)% ⊦ m ≤ n ↔ ¬ n < m; (ss)% ⊦ ¬ PEB_SIZE < EB_PAGE_SIZE; (s)