| # wlar = # apebs1, apebs1[vtblpnum2] = mkpeb(aehdr, empty, buf0, m, false), buf = mkbuf(LEB_SIZE), vtbl = ∅, vtblpnum2 ≠ # apebs1, aehdr.valid?, vtblpnum2 < # apebs1, ubi-io-initial(apebs1), ubi-io-inv(apebs1[vtblpnum2, mkpeb(aehdr, avidhdr(VTBL_VOLID, VTBL_LNUM, 0, 0, 0), buf0, m, false)]), ENCODED_NAT_SIZE ≤ LEB_SIZE, ∀ n3. n3 < # apebs1 → (apebs1[n3].bad → wlar[n3] = wl-entry(0, erroneous)) ∧ (¬ apebs1[n3].bad → apebs1[n3].echdr.valid? ∧ wlar[n3] = wl-entry(apebs1[n3].echdr.ec, free) ∧ apebs1[n3].vidhdr = empty) ⊦ ⟪encode_vtbl#(; vtbl, buf; err0); vtblpnum1 := LEB_SIZE; apebs0 := apebs1[vtblpnum2, apebs1[vtblpnum2].vidhdr:= avidhdr(VTBL_VOLID, VTBL_LNUM, 0, 0, 0)]; if err0 = ESUCCESS then aubi_io_write_data#(vtblpnum2, 0, 0, vtblpnum1, buf; apebs0; err0); vols := ∅; wlar[vtblpnum2] := wl-entry(wlar[vtblpnum2].ec, used); q := []; sqnum := 1; bflipset := ∅⟫ ( ( err0 = ESUCCESS → # apebs0 = # wlar ∧ unique-sqns(apebs0) ∧ valid-global-sqn(apebs0, sqnum) ∧ valid-wl(apebs0, wlar) ∧ valid-eraseq(q) ∧ valid-eraseq(wlar, q) ∧ valid-eraseq(apebs0, q) ∧ ¬ VTBL_VOLID ∈ vols ∧ bflipset-cons(bflipset, wlar) ∧ valid-ebatbl(apebs0, wlar, vols, vtblpnum2) ∧ valid-vtbl(apebs0, vols, wlar, vtblpnum2) ∧ vtblpnum1 = LEB_SIZE ∧ ubi-io-inv(apebs0)) ∧ (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ (err0 = ESUCCESS → vols = ∅)) |
# buf ≥ # vtbl * (ENCODED_NAT_SIZE + ENCODED_VOLID_SIZE) + ENCODED_NAT_SIZE, buf0 = buf, vtbl0 = vtbl ⊦ ⟪encode_vtbl#(; vtbl, buf; err)⟫ ((err = ESUCCESS ∨ ⌊err⌋ ) ∧ # buf = # buf0 ∧ (err = ESUCCESS → is-encoded(vtbl0, buf)))
# wlar = # apebs1, apebs1[vtblpnum2] = mkpeb(aehdr, empty, buf0, m, false), buf = mkbuf(LEB_SIZE), buf = buf, buf1 = buf, vtbl = ∅, vtbl = vtbl, vtbl1 = vtbl, aehdr.valid?, vtblpnum2 < # apebs1, ubi-io-initial(apebs1), ubi-io-inv(apebs1[vtblpnum2, mkpeb(aehdr, avidhdr(VTBL_VOLID, VTBL_LNUM, 0, 0, 0), buf0, m, false)]), ENCODED_NAT_SIZE ≤ LEB_SIZE, # buf ≥ # vtbl * (ENCODED_NAT_SIZE + ENCODED_VOLID_SIZE) + ENCODED_NAT_SIZE, ∀ n3. n3 < # apebs1 → (apebs1[n3].bad → wlar[n3] = wl-entry(0, erroneous)) ∧ (¬ apebs1[n3].bad → apebs1[n3].echdr.valid? ∧ wlar[n3] = wl-entry(apebs1[n3].echdr.ec, free) ∧ apebs1[n3].vidhdr = empty) ⊦ [encode_vtbl#(; vtbl, buf; err0)] ( (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ # buf = # buf1 ∧ (err0 = ESUCCESS → is-encoded(vtbl1, buf)) → ⟪vtblpnum1 := LEB_SIZE; apebs0 := apebs1[vtblpnum2, apebs1[vtblpnum2].vidhdr:= avidhdr(VTBL_VOLID, VTBL_LNUM, 0, 0, 0)]; if err0 = ESUCCESS then aubi_io_write_data#(vtblpnum2, 0, 0, vtblpnum1, buf; apebs0; err0); vols := ∅; wlar[vtblpnum2] := wl-entry(wlar[vtblpnum2].ec, used); q := []; sqnum := 1; bflipset := ∅⟫ ( ( err0 = ESUCCESS → # apebs0 = # wlar ∧ unique-sqns(apebs0) ∧ valid-global-sqn(apebs0, sqnum) ∧ valid-wl(apebs0, wlar) ∧ valid-eraseq(q) ∧ valid-eraseq(wlar, q) ∧ valid-eraseq(apebs0, q) ∧ ¬ VTBL_VOLID ∈ vols ∧ bflipset-cons(bflipset, wlar) ∧ valid-ebatbl(apebs0, wlar, vols, vtblpnum2) ∧ valid-vtbl(apebs0, vols, wlar, vtblpnum2) ∧ vtblpnum1 = LEB_SIZE ∧ ubi-io-inv(apebs0)) ∧ (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ (err0 = ESUCCESS → vols = ∅))), vtblpnum2 = # apebs1
Used simplifier rules: ⊦ # mkbuf(n) = n; (s)% ⊦ # ∅ = 0; (s)% ⊦ 0 * n = 0; (s)%mult-a: ⊦ m0 * m * n = (m0 * m) * n; from specification nat-mult%mult-c: ⊦ m * n = n * m; from specification nat-mult% ⊦ n + 0 = n; (s)%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic%c: ⊦ m + n = n + m; from specification nat-basic% ⊦ n ≥ m ↔ m ≤ n; (s)