| # lpt1 = # avol, # lpt0 = # avol, EB_PAGE_SIZE = # buf1 + # buf0 % EB_PAGE_SIZE, lpt1[pstate.lnum] = mklp(m1, # buf0, lpf, m4), avol[pstate.lnum] = mapped(buf0), lpt1[pstate.lnum] = mklp(m, m0, lpf0, m3), keyset(gch) = gc-heap(lpt1, log1), remove-refsize0(istore0) = istore0, remove-refsize0(gstore0) = gstore0, elems log1 ∩ ginval = ∅, dom gstore0 ∪ elems log1 = dom gstore ∪ ginval, pstate.lnum < # avol, ginval < # avol, abs-gstore(avol, lpt1, gstore, ginval), abs-istore(avol, lpt1, istore), abs-padding(buf1), awbuf-inv(avol, buffered(pstate.lnum)), bin-heap-inv(gch, lpt1), buf-ro-rw-mode(false, buffered(pstate.lnum), lpt1, avol), bufs-log-only(buffered(pstate.lnum), log1, lpt1), flash-lpt-cons(lpt0, istore0, gstore0), freelist-cons(lpt1, freelist), inv(istore0), inv(istore), inv(gstore0), inv(gstore \ ginval), is-aligned(# buf0, 2 * NODE_HEADER_SIZE), log-group-block(log1, lpt1), lpt-free-unref(lpt1), lpt-free-unref(lpt0), lpt-leb-size(lpt1), lpt-leb-size(lpt0), lpt-ram-flash(lpt1, lpt0, log1), # buf0 + # buf1 ≤ LEB_SIZE, # buf0 ≤ LEB_SIZE, istore0 ⊑ istore, ⌊err0⌋ , pstate.index? → pstate.lnum ∈ istore, pstate.journal? → log1 ≠ [] ∧ pstate.lnum = log1.last ∧ pstate.lnum ∈ gstore, pstate.index? ∨ pstate.journal? ⊦ [awbuf_enter_readonly#(adr0, m2, log1, avol, lpt0, ns0, buffered(pstate.lnum); ; isbuf2)] ( (lpf0 = LP_FREE → m = 0) ∧ freelist-cons(lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], freelist) ∧ bin-heap-inv(gch, lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)]) ∧ keyset(gch) = gc-heap(lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], log1) ∧ log-group-block(log1, lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)]) ∧ buf-ro-rw-mode(isbuf2, buffered(pstate.lnum), lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], avol) ∧ lpt-ram-flash(lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], lpt0, log1) → ⟨isbuf1 := false; pstate0 := pstate; pstate1 := pstate; apersistence_sync#(adr0, istore, istore0, ginval, gstore, gstore0, log1, m2, ns0; pstate, isbuf1; err1)⟩ ( abs-istore (avol, lpt1[pstate1.lnum, mklp(lpt1[pstate1.lnum].ref-size, LEB_SIZE, lpt1[pstate1.lnum].flags, lpt1[pstate1.lnum].gcheapidx)], istore) ∧ abs-gstore (avol, lpt1[pstate1.lnum, mklp(lpt1[pstate1.lnum].ref-size, LEB_SIZE, lpt1[pstate1.lnum].flags, lpt1[pstate1.lnum].gcheapidx)], gstore, ginval) ∧ ginval < # lpt1 ∧ (isbuf1 → synced(avol)) ∧ pstate ≠ unbuffered ∧ (pstate = readonly ↔ isbuf2) ∧ (pstate ≠ readonly → pstate0.lnum = pstate.lnum) ∧ err0 = err1)), buf1 = mkbuf(0), lpf = LP_FREE, pstate = readonly, pstate = unbuffered, dups(log1), is-aligned(# buf0, EB_PAGE_SIZE) |
# lpt0 = # avol, # lpt1 = # avol, EB_PAGE_SIZE = # buf1 + # buf0 % EB_PAGE_SIZE, avol[pstate.lnum] = mapped(buf0), lpt1[pstate.lnum] = mklp(m, # buf0, lpf0, m3), keyset(gch) = gc-heap(lpt1, log1), remove-refsize0(gstore0) = gstore0, remove-refsize0(istore0) = istore0, elems log1 ∩ ginval = ∅, dom gstore0 ∪ elems log1 = dom gstore ∪ ginval, buf1 ≠ mkbuf(0), lpf0 ≠ LP_FREE, pstate ≠ unbuffered, pstate ≠ readonly, ginval < # avol, pstate.lnum < # avol, abs-gstore(avol, lpt1, gstore, ginval), abs-istore(avol, lpt1, istore), abs-padding(buf1), awbuf-inv(avol, buffered(pstate.lnum)), bin-heap-inv(gch, lpt1), buf-ro-rw-mode(false, buffered(pstate.lnum), lpt1, avol), bufs-log-only(buffered(pstate.lnum), log1, lpt1), flash-lpt-cons(lpt0, istore0, gstore0), freelist-cons(lpt1, freelist), inv(gstore \ ginval), inv(gstore0), inv(istore), inv(istore0), is-aligned(# buf0, 2 * NODE_HEADER_SIZE), log-group-block(log1, lpt1), lpt-free-unref(lpt0), lpt-free-unref(lpt1), lpt-leb-size(lpt0), lpt-leb-size(lpt1), lpt-ram-flash(lpt1, lpt0, log1), # buf0 ≤ LEB_SIZE, # buf0 + # buf1 ≤ LEB_SIZE, istore0 ⊑ istore, ⌊err0⌋ , ¬ dups(log1), ¬ is-aligned(# buf0, EB_PAGE_SIZE), pstate.journal? → log1 ≠ [] ∧ pstate.lnum = log1.last ∧ pstate.lnum ∈ gstore, pstate.index? → pstate.lnum ∈ istore, pstate.index? ∨ pstate.journal? ⊦ [awbuf_enter_readonly#(adr0, m2, log1, avol, lpt0, ns0, buffered(pstate.lnum); ; isbuf2)] ( keyset(gch) = gc-heap(lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], log1) ∧ log-group-block(log1, lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)]) ∧ buf-ro-rw-mode(isbuf2, buffered(pstate.lnum), lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], avol) ∧ lpt-ram-flash(lpt1[pstate.lnum, mklp(m, LEB_SIZE, lpf0, m3)], lpt0, log1) → ⟨isbuf1 := false; pstate0 := pstate; pstate1 := pstate; apersistence_sync#(adr0, istore, istore0, ginval, gstore, gstore0, log1, m2, ns0; pstate, isbuf1; err1)⟩ ( abs-istore (avol, lpt1[pstate1.lnum, mklp(lpt1[pstate1.lnum].ref-size, LEB_SIZE, lpt1[pstate1.lnum].flags, lpt1[pstate1.lnum].gcheapidx)], istore) ∧ abs-gstore (avol, lpt1[pstate1.lnum, mklp(lpt1[pstate1.lnum].ref-size, LEB_SIZE, lpt1[pstate1.lnum].flags, lpt1[pstate1.lnum].gcheapidx)], gstore, ginval) ∧ ginval < # lpt1 ∧ (isbuf1 → synced(avol)) ∧ pstate ≠ unbuffered ∧ (pstate = readonly ↔ isbuf2) ∧ (pstate ≠ readonly → pstate0.lnum = pstate.lnum) ∧ err0 = err1))
Used simplifier rules: ⊦ mklp(m, m0, lpf, m1) = mklp(m2, m3, lpf0, m4) ↔ m = m2 ∧ m0 = m3 ∧ lpf = lpf0 ∧ m1 = m4; (ws)%n < # lpt ⊦ lpt[n] = mklp(m0, m1, lpf0, m2) → ( bin-heap-inv(gch, lpt[n, mklp(n0, n1, lpf1, m2)]) ↔ bin-heap-inv(gch, lpt)); (s)% ⊦ m < n → (n ≤ m ↔ false); (s)% ⊦ m < n ↔ ¬ n ≤ m; (ss)%⊦ freelist-cons(lpt, freelist) ∧ lpt[n] = mklp(m0, m1, lpf, m2) → freelist-cons(lpt[n, mklp(n0, n1, lpf, n2)], freelist); (s)