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