| # lpt0 = # avol, # lpt1 = # avol, isbuf0 ↔ pstate = readonly, adr = adr0, isbuf0, keyset(gch) = gc-heap(lpt1, log1), log = log1, lpt = lpt0, ns = ns0, remove-refsize0(istore0) = istore0, remove-refsize0(gstore0) = gstore0, elems log1 ∩ ginval = ∅, dom gstore0 ∪ elems log1 = dom gstore ∪ ginval, ginval < # avol, abs-gstore(avol, lpt1, gstore, ginval), abs-istore(avol, lpt1, istore), awbuf-inv(avol, bleb), bin-heap-inv(gch, lpt1), buf-ro-rw-mode(pstate = readonly, bleb, lpt1, avol), bufs-log-only(bleb, log1, lpt1), flash-lpt-cons(lpt0, istore0, gstore0), freelist-cons(lpt1, freelist), inv(istore0), inv(istore), inv(gstore0), inv(gstore \ ginval), 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), synced(avol), istore0 ⊑ istore, pstate.index? → pstate.lnum ∈ istore, pstate.journal? → log1 ≠ [] ∧ pstate.lnum = log1.last ∧ pstate.lnum ∈ gstore, pstate ≠ unbuffered ∧ pstate ≠ readonly → bleb = buffered(pstate.lnum), pstate = unbuffered → bleb = nobuffer ⊦ ⟪err := EROFS; if err = ESUCCESS then {awbuf_move_buf#(n, 0, adr0, m, log1, avol, lpt0, ns0, pstate = readonly; bleb; err); if err ≠ ESUCCESS then freelist := n ' + freelist else lpt1[n].flags := LP_INDEX_NODES}⟫ ⟨pstate0 := pstate; apersistence_allocate_ind#(adr0, istore0, ginval, gstore, gstore0, log1, m, ns0, true; istore, pstate; err0)⟩ ( abs-istore(avol, lpt1, istore) ∧ abs-gstore(avol, lpt1, gstore, ginval) ∧ ginval < # lpt1 ∧ synced(avol) ∧ (pstate = unbuffered → bleb = nobuffer) ∧ (pstate = readonly ↔ pstate0 = readonly) ∧ (pstate ≠ unbuffered ∧ pstate ≠ readonly → bleb = buffered(pstate.lnum)) ∧ err = err0), dups(log1) |
# lpt1 = # avol, # lpt0 = # avol, isbuf0 ↔ pstate = readonly, adr = adr0, err = EROFS, isbuf0, keyset(gch) = gc-heap(lpt1, log1), log = log1, lpt = lpt0, ns = ns0, remove-refsize0(gstore0) = gstore0, remove-refsize0(istore0) = istore0, elems log1 ∩ ginval = ∅, dom gstore0 ∪ elems log1 = dom gstore ∪ ginval, ginval < # avol, abs-gstore(avol, lpt1, gstore, ginval), abs-istore(avol, lpt1, istore), awbuf-inv(avol, bleb), bin-heap-inv(gch, lpt1), buf-ro-rw-mode(pstate = readonly, bleb, lpt1, avol), bufs-log-only(bleb, log1, lpt1), flash-lpt-cons(lpt0, istore0, gstore0), freelist-cons(lpt1, freelist), inv(gstore \ ginval), inv(gstore0), inv(istore), inv(istore0), 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), synced(avol), istore0 ⊑ istore, pstate = unbuffered → bleb = nobuffer, pstate ≠ unbuffered ∧ pstate ≠ readonly → bleb = buffered(pstate.lnum), pstate.journal? → log1 ≠ [] ∧ pstate.lnum = log1.last ∧ pstate.lnum ∈ gstore, pstate.index? → pstate.lnum ∈ istore ⊦ ⟪if err = ESUCCESS then {awbuf_move_buf#(n, 0, adr0, m, log1, avol, lpt0, ns0, pstate = readonly; bleb; err); if err ≠ ESUCCESS then freelist := n ' + freelist else lpt1[n].flags := LP_INDEX_NODES}⟫ ⟨pstate0 := pstate; apersistence_allocate_ind#(adr0, istore0, ginval, gstore, gstore0, log1, m, ns0, true; istore, pstate; err0)⟩ ( abs-istore(avol, lpt1, istore) ∧ abs-gstore(avol, lpt1, gstore, ginval) ∧ ginval < # lpt1 ∧ synced(avol) ∧ (pstate = unbuffered → bleb = nobuffer) ∧ (pstate = readonly ↔ pstate0 = readonly) ∧ (pstate ≠ unbuffered ∧ pstate ≠ readonly → bleb = buffered(pstate.lnum)) ∧ err = err0), dups(log1)