| wlar[n] = wl-entry(m0, stat0), apebs0[n] = mkpeb(aehdr, avhdr, buf, m1, false), err0 ≠ ESUCCESS, vtblpnum1 ≠ 0, n < # wlar, n < # apebs0, vtblpnum1 ≤ UBI_ERASE_RETRIES, vtblpnum1 ≤ UBI_ERASE_RETRIES + 1, ⌊err⌋ ⊦ [aubi_io_sync_erase#(n; apebs; err0); wlar1 := wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)] [n, wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec:= (wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec + 1) ]; if err0 = ESUCCESS then aubi_io_write_echdr#(n, aechdr(wlar1[n].ec); apebs; err0) else debug#("ubi: erase of PEB " + n.toString + " failed"); vtblpnum1 := vtblpnum1 + 1] (id○(wlar, wlar1, n) ∧ vtblpnum1 ≠ 0 ∧ vtblpnum1 ≤ UBI_ERASE_RETRIES + 1 ∧ (∃ stat. wlar1 = wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)])) |
apebs0[n] = mkpeb(aehdr, avhdr, buf, m1, false), wlar[n] = wl-entry(m0, stat0), vtblpnum = n, n < # apebs0, n < # wlar, vtblpnum1 ≤ UBI_ERASE_RETRIES + 1, vtblpnum1 ≤ UBI_ERASE_RETRIES, ⌊err⌋ ⊦ [if ubi-io-erase-pre(vtblpnum, apebs) then {fail_or_success#(; ; err); if err = ESUCCESS then apebs[vtblpnum] := mkpeb(empty, empty, mkempbuf(LEB_SIZE), 0, false) else {choose apeb with ubi-io-peb-inv(apeb) ∧ ¬ apeb.bad ∧ ¬ apeb.vidhdr.valid? in apebs[vtblpnum] := apeb or skip}} else abort; wlar1 := wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)] [n, wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec:= (wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)][n].ec + 1) ]; if err = ESUCCESS then aubi_io_write_echdr#(n, aechdr(wlar1[n].ec); apebs; err0) else debug#("ubi: erase of PEB " + n.toString + " failed"); vtblpnum1 := vtblpnum1 + 1] (id○(wlar, wlar1, n) ∧ vtblpnum1 ≠ 0 ∧ vtblpnum1 ≤ UBI_ERASE_RETRIES + 1 ∧ (∃ stat. wlar1 = wlar[n, wl-entry(wlar[n].ec + vtblpnum1, stat)])), err0 = ESUCCESS, vtblpnum1 = 0
Used simplifier rules: aubi_io_sync_erase#(PNUM; APEBS; ERR) {if ubi-io-erase-pre(PNUM, APEBS) then {fail_or_success#(; ; ERR); if ERR = ESUCCESS then APEBS[PNUM] := mkpeb(empty, empty, mkempbuf(LEB_SIZE), 0, false) else { choose APEB with ubi-io-peb-inv(APEB) ∧ ¬ APEB.bad ∧ ¬ APEB.vidhdr.valid? in APEBS[PNUM] := APEB or skip}} else abort };