| # 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 |
# pebs0 = n0 + m1, # pebs1 = n0 + m1, # buf1 = EB_PAGE_SIZE, 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(pebs0), mtd-cons(pebs1), mtd-cons(pebs1[m1, mkpeb(emptypeb, 0, false)]), ubi-io-initial(subarray(pebs1, 0, m1)), EB_PAGE_SIZE ≤ PEB_SIZE ⊦ [mtd_asm_write#(m1, 0, 0, EB_PAGE_SIZE, buf1; pebs; err)] ( mtd-cons(pebs) → ⟪m1 := m1 + 1⟫ ( m1 ≤ # pebs0 ∧ # pebs0 = # pebs ∧ (err = ESUCCESS → ubi-io-initial(subarray(pebs, 0, m1))) ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ # pebs0 < n0 + m1))
Used simplifier rules: ⊦ m ≤ m; (s)% ⊦ m < m + n ↔ n ≠ 0; (s)%let: ⊦ n ≤ n0 ∧ n0 ≤ n1 → n ≤ n1; (forward) from specification nat% ⊦ mkpeb(buf, m, boolvar).bad ↔ boolvar; (s)% ⊦ m < # pebs → pebs[m, peb][m] = peb; (s)% ⊦ # pebs[n, peb] = # pebs; (s)%n ≠ 0 ⊦ is-aligned(0, n); (s)%n ≠ 0 ⊦ is-aligned(n, n); (s)% ⊦ EB_PAGE_SIZE ≠ 0; (s)% ⊦ mkpeb(buf, m, boolvar).fill = m; (s)%m < # pebs ⊦ pebs[m, peb][m] = peb; (s)% ⊦ m + m0 ≤ m ↔ m0 = 0; (s)% ⊦ m < n ↔ ¬ n ≤ m; (ss)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ n + 0 = n; (s)