| # apebs = # wlar, apebs[n] = mkpeb(aehdr, avhdr, buf1, m0, false), vols[v][vtblpnum3] = ⌜n⌝ , avols[v][vtblpnum3] = mapped(buf1, m), n0 = 0, n1 = n2, vtblpnum = vtblpnum5, vtblpnum0 = vtblpnum3, avhdr.valid?, n < # wlar, vtblpnum3 < # vols[v], vtblpnum3 < # avols[v], abs(avols, apebs, vols, q), bflipset-cons(bflipset, wlar), ebm-cons(avols), is-aligned(vtblpnum5, EB_PAGE_SIZE), ubi-io-inv(apebs), ubi-io-peb-inv(mkpeb(aehdr, avhdr, buf1, m0, false)), unique-sqns(apebs), valid-ebatbl(apebs, wlar, vols, vtblpnum4), valid-eraseq(apebs, q), valid-eraseq(wlar, q), valid-eraseq(q), valid-global-sqn(apebs, sqnum), valid-vtbl(apebs, vols, wlar, vtblpnum4), valid-wl(apebs, wlar), v ∈ vols, v ∈ avols, m ≤ LEB_SIZE, m0 ≤ vtblpnum5, vtblpnum5 ≤ LEB_SIZE, n2 ≤ # buf, m ≤ vtblpnum5, m0 ≤ LEB_SIZE ⊦ ⟨if v ∈ avols ∧ vtblpnum0 < # avols[v] ∧ vtblpnum + n0 ≤ LEB_SIZE ∧ is-aligned(vtblpnum, EB_PAGE_SIZE) ∧ is-aligned(n0, EB_PAGE_SIZE) ∧ n0 + n1 ≤ # buf ∧ (avols[v][vtblpnum0].mapped? → vtblpnum ≥ avols[v][vtblpnum0].fill) then {fail_or_success#(; ; err); if err = ESUCCESS then if avols[v][vtblpnum0].mapped? then if n0 ≠ 0 then avols[v][vtblpnum0] := mapped (subarray(avols[v][vtblpnum0].data, 0, vtblpnum) + subarray(buf, n1, n0) + mkempbuf(LEB_SIZE - vtblpnum - n0), vtblpnum + n0) else avols[v][vtblpnum0] := mapped(mkempbuf(vtblpnum) + subarray(buf, n1, n0) + mkempbuf(LEB_SIZE - vtblpnum - n0), vtblpnum + n0) else if avols[v][vtblpnum0].mapped? then choose n with n < n0 ∧ is-aligned(n, EB_PAGE_SIZE) in if n ≠ 0 then avols[v][vtblpnum0] := mapped (subarray(avols[v][vtblpnum0].data, 0, vtblpnum) + subarray(buf, n1, n) + mkempbuf(LEB_SIZE - vtblpnum - n), vtblpnum + n) ifnone skip else if n0 ≠ 0 then avols[v][vtblpnum0] := unmapped} else abort⟩ (abs(avols, apebs, vols, q) ∧ ESUCCESS = err), VTBL_VOLID ∈ vols |
# apebs = # wlar, avols[v][vtblpnum3] = mapped(buf1, m), vols[v][vtblpnum3] = ⌜n⌝ , apebs[n] = mkpeb(aehdr, avhdr, buf1, m0, false), n0 = 0, n1 = n2, vtblpnum = vtblpnum5, vtblpnum0 = vtblpnum3, avhdr.valid?, vtblpnum3 < # avols[v], vtblpnum3 < # vols[v], n < # wlar, abs(avols, apebs, vols, q), bflipset-cons(bflipset, wlar), ebm-cons(avols), is-aligned(vtblpnum5, EB_PAGE_SIZE), ubi-io-inv(apebs), ubi-io-peb-inv(mkpeb(aehdr, avhdr, buf1, m0, false)), unique-sqns(apebs), valid-ebatbl(apebs, wlar, vols, vtblpnum4), valid-eraseq(q), valid-eraseq(wlar, q), valid-eraseq(apebs, q), valid-global-sqn(apebs, sqnum), valid-vtbl(apebs, vols, wlar, vtblpnum4), valid-wl(apebs, wlar), v ∈ avols, v ∈ vols, m0 ≤ LEB_SIZE, m ≤ vtblpnum5, n2 ≤ # buf, vtblpnum5 ≤ LEB_SIZE, m0 ≤ vtblpnum5, m ≤ LEB_SIZE ⊦ ⟨fail_or_success#(; ; err); if err = ESUCCESS then if avols[v][vtblpnum0].mapped? then if n0 ≠ 0 then avols[v][vtblpnum0] := mapped (subarray(avols[v][vtblpnum0].data, 0, vtblpnum) + subarray(buf, n1, n0) + mkempbuf(LEB_SIZE - vtblpnum - n0), vtblpnum + n0) else avols[v][vtblpnum0] := mapped(mkempbuf(vtblpnum) + subarray(buf, n1, n0) + mkempbuf(LEB_SIZE - vtblpnum - n0), vtblpnum + n0) else if avols[v][vtblpnum0].mapped? then choose n with n < n0 ∧ is-aligned(n, EB_PAGE_SIZE) in if n ≠ 0 then avols[v][vtblpnum0] := mapped (subarray(avols[v][vtblpnum0].data, 0, vtblpnum) + subarray(buf, n1, n) + mkempbuf(LEB_SIZE - vtblpnum - n), vtblpnum + n) ifnone skip else if n0 ≠ 0 then avols[v][vtblpnum0] := unmapped⟩ (abs(avols, apebs, vols, q) ∧ ESUCCESS = err), VTBL_VOLID ∈ vols
Used simplifier rules: ⊦ v ∈ vols ∧ abs(avols, apebs, vols, q) → v ∈ avols; (ss)% ⊦ 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)%⊦ v ∈ vols ∧ m < # vols[v] ∧ abs(avols, apebs, vols, q) → m < # avols[v]; (ss)% ⊦ mapped(buf, m).mapped?; (s)% ⊦ mapped(buf, m).fill = m; (s)% ⊦ n ≥ m ↔ m ≤ n; (s)