| # lpt0 = # avol0, # lpt2 = # avol0, lpt2[n0] = mklp(0, m5, LP_FREE, m6), keyset(gch) = gc-heap(lpt2, log1), pstate0 = pstate, remove-refsize0(istore0) = istore0, remove-refsize0(gstore0) = gstore0, elems log1 ∩ ginval = ∅, dom gstore0 ∪ elems log1 = dom gstore ∪ ginval, bleb ≠ buffered(n0), pstate ≠ readonly, n0 < # avol0, ginval < # avol0, abs-gstore(avol0, lpt2, gstore, ginval), abs-istore(avol0, lpt2, istore), awbuf-inv(avol0, bleb), bin-heap-inv(gch, lpt2), buf-ro-rw-mode(false, bleb, lpt2, avol0), bufs-log-only(bleb, log1, lpt2), flash-lpt-cons(lpt0, istore0, gstore0), freelist-cons(lpt2, n0 ' + nx0), inv(istore0), inv(istore), inv(gstore0), inv(gstore \ ginval), log-group-block(log1, lpt2), lpt-free-unref(lpt0), lpt-free-unref(lpt2), lpt-leb-size(lpt0), lpt-leb-size(lpt2), lpt-ram-flash(lpt2, lpt0, log1), synced(avol0), istore0 ⊑ istore, ¬ dups(log1), pstate ≠ unbuffered → bleb = buffered(pstate.lnum), pstate.index? → pstate.lnum ∈ istore, pstate.journal? → log1 ≠ [] ∧ pstate.lnum = log1.last ∧ pstate.lnum ∈ gstore, pstate = unbuffered → bleb = nobuffer, bleb ≠ nobuffer → avol0[n0, mapped(mkbuf(0))][bleb.leb].mapped? ∧ bleb.leb < # avol0 ∧ bleb.isbuf?, bleb = nobuffer ∨ is-aligned(# avol0[n0, mapped(mkbuf(0))][bleb.leb].data, EB_PAGE_SIZE) ⊦ ⟨apersistence_allocate_ind#(adr0, istore0, ginval, gstore, gstore0, log1, m, ns0, true; istore, pstate; err1)⟩ ( abs-istore(avol0[n0, mapped(mkbuf(0))], lpt2[n0, mklp(0, 0, LP_INDEX_NODES, m6)], istore) ∧ pstate ≠ unbuffered ∧ (pstate = readonly ↔ pstate0 = readonly) ∧ (pstate ≠ readonly → n0 = pstate.lnum) ∧ ESUCCESS = err1) |
# lpt2 = # avol0, # lpt0 = # avol0, isbuf ↔ true, lpt2[n0] = mklp(0, m5, LP_FREE, m6), adr = adr0, gstore = gstore1, gstore0 = gstore2, keyset(gch) = gc-heap(lpt2, log1), log = log1, maxino = m, ns = ns0, pstate0 = pstate, remove-refsize0(gstore1) = gstore1, remove-refsize0(istore0) = istore0, elems log1 ∩ ginval = ∅, dom gstore1 ∪ elems log1 = dom gstore2 ∪ ginval, ginval < # avol0, n0 < # avol0, abs-gstore(avol0, lpt2, gstore2, ginval), abs-istore(avol0, lpt2, istore), awbuf-inv(avol0, bleb), bin-heap-inv(gch, lpt2), buf-ro-rw-mode(false, bleb, lpt2, avol0), bufs-log-only(bleb, log1, lpt2), flash-lpt-cons(lpt0, istore0, gstore1), freelist-cons(lpt2, n0 ' + nx0), inv(gstore2 \ ginval), inv(gstore1), inv(istore), inv(istore0), log-group-block(log1, lpt2), lpt-free-unref(lpt2), lpt-free-unref(lpt0), lpt-leb-size(lpt2), lpt-leb-size(lpt0), lpt-ram-flash(lpt2, lpt0, log1), synced(avol0), istore0 ⊑ istore, bleb ≠ nobuffer → avol0[n0, mapped(mkbuf(0))][bleb.leb].mapped? ∧ bleb.leb < # avol0 ∧ bleb.isbuf?, pstate = unbuffered → bleb = nobuffer, pstate.journal? → log1 ≠ [] ∧ pstate.lnum = log1.last ∧ pstate.lnum ∈ gstore2, pstate.index? → pstate.lnum ∈ istore, pstate ≠ unbuffered → bleb = buffered(pstate.lnum), bleb = nobuffer ∨ is-aligned(# avol0[n0, mapped(mkbuf(0))][bleb.leb].data, EB_PAGE_SIZE) ⊦ ⟨if isbuf then {fail_or_success#(; ; err); if err = ESUCCESS then choose n with ¬ n ∈ istore in istore[n] := indexblock([], [], 0), pstate := index(n)} else abort⟩ ( abs-istore(avol0[n0, mapped(mkbuf(0))], lpt2[n0, mklp(0, 0, LP_INDEX_NODES, m6)], istore) ∧ pstate ≠ unbuffered ∧ (pstate = readonly ↔ pstate0 = readonly) ∧ (pstate ≠ readonly → n0 = pstate.lnum) ∧ ESUCCESS = err), bleb = buffered(n0), pstate = readonly, dups(log1)
Used simplifier rules: apersistence_allocate_ind# (ROOTADR, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS, PSYNCED ; ISTORE, PSTATE ; ERR ) {if PSYNCED then {fail_or_success#(; ; ERR); if ERR = ESUCCESS then choose N with ¬ N ∈ ISTORE in ISTORE[N] := indexblock([], [], 0), PSTATE := index(N)} else abort };