| wlar[n] = wl-entry(m0, stat0), apebs0[n] = mkpeb(aehdr, avhdr, buf, m1, false), apebs1[n] = mkpeb(aehdr0, avhdr0, buf0, m, false), apebs = apebs1[n, mkpeb(empty, empty, mkempbuf(LEB_SIZE), 0, false)], err1 ≠ ESUCCESS, vtblpnum1 ≠ 0, n < # apebs0, n < # apebs1, n < # wlar, vtblpnum1 ≤ UBI_ERASE_RETRIES, vtblpnum1 ≤ UBI_ERASE_RETRIES + 1, ⌊err2⌋ ⊦ [aubi_io_write_echdr# (n, aechdr(wlar[n, wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec:= (wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec + 1)][n].ec) ; apebs ; err1); vtblpnum := vtblpnum1 + 1] ( vtblpnum ≠ 0 ∧ vtblpnum ≤ UBI_ERASE_RETRIES + 1 ∧ (∃ stat1. wlar[n, wl-entry((wlar[n].ec + vtblpnum1) + 1, stat)] = wlar[n, wl-entry(wlar[n].ec + vtblpnum, stat1)])) |
apebs1[n] = mkpeb(aehdr0, avhdr0, buf0, m, false), apebs0[n] = mkpeb(aehdr1, avhdr, buf, m1, false), wlar[n] = wl-entry(m0, stat0), aehdr = aechdr(wlar[n, wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec:= (wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec + 1)][n].ec), apebs = apebs1[n, mkpeb(empty, empty, mkempbuf(LEB_SIZE), 0, false)], vtblpnum = n, n < # wlar[n, wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec:= (wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec + 1)], n < # wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)], n < # wlar, n < # apebs1, n < # apebs0, vtblpnum1 ≤ UBI_ERASE_RETRIES + 1, vtblpnum1 ≤ UBI_ERASE_RETRIES, ⌊err2⌋ ⊦ [if ubi-io-write-echdr-pre(vtblpnum, aehdr, apebs) then {fail_or_success#(; ; err); if err = ESUCCESS then apebs[vtblpnum].echdr := aehdr else choose aehdr with ¬ aehdr.valid? in apebs[vtblpnum].echdr := aehdr} else abort; vtblpnum := vtblpnum1 + 1] ( vtblpnum ≠ 0 ∧ vtblpnum ≤ UBI_ERASE_RETRIES + 1 ∧ (∃ stat1. wlar[n, wl-entry((wlar[n].ec + vtblpnum1) + 1, stat)] = wlar[n, wl-entry(wlar[n].ec + vtblpnum, stat1)])), err1 = ESUCCESS, vtblpnum1 = 0
Used simplifier rules: aubi_io_write_echdr#(PNUM, AEHDR; APEBS; ERR) {if ubi-io-write-echdr-pre(PNUM, AEHDR, APEBS) then {fail_or_success#(; ; ERR); if ERR = ESUCCESS then APEBS[PNUM].echdr := AEHDR else choose AEHDR with ¬ AEHDR.valid? in APEBS[PNUM].echdr := AEHDR} else abort };