| # lpt0 = # avol, # lpt1 = # avol, lpt1[bleb.leb] = mklp(m3, m1, lpf, m2), ax = ax0, keyset(gch) = gc-heap(lpt1, log1), pstate = readonly, 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(true, 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(lpt0), lpt-free-unref(lpt1), lpt-leb-size(lpt0), lpt-leb-size(lpt1), lpt-ram-flash(lpt1, lpt0, log1), istore0 ⊑ istore, ¬ dups(log1), isbuf1 → synced(avol) ⊦ ⟨apersistence_add_gnds#(gndx0, adr0, istore, istore0, ginval, gstore0, log1, m, ns0; ax0, gstore, pstate, isbuf1; err0)⟩ (abs-gstore(avol, lpt1, gstore, ginval) ∧ (isbuf1 → synced(avol)) ∧ pstate = readonly ∧ ax = ax0 ∧ EROFS = err0) |
# lpt1 = # avol, # lpt0 = # avol, isbuf ↔ isbuf1, lpt1[bleb.leb] = mklp(m3, m1, lpf, m2), adr = adr0, ax = ax0, ax1 = ax0, gndx = gndx0, istore = istore1, istore0 = istore2, keyset(gch) = gc-heap(lpt1, log1), log = log1, maxino = m, ns = ns0, pstate = readonly, remove-refsize0(istore1) = istore1, 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, istore2), awbuf-inv(avol, bleb), bin-heap-inv(gch, lpt1), buf-ro-rw-mode(true, bleb, lpt1, avol), bufs-log-only(bleb, log1, lpt1), flash-lpt-cons(lpt0, istore1, gstore0), freelist-cons(lpt1, freelist), inv(istore1), inv(istore2), inv(gstore0), inv(gstore \ ginval), 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), istore1 ⊑ istore2, isbuf1 → synced(avol) ⊦ ⟨if pstate.journal? ∨ pstate = readonly then if pstate = readonly then err0 := EROFS else {choose lax, err with (⌊err⌋ ∨ err = ESUCCESS) ∧ ¬ dups(gstore[pstate.lnum].ladrlist + lax) ∧ # lax ≤ # gndx ∧ inv-flashsize(prefixn(# lax, gndx), lax) ∧ (err = ESUCCESS ↔ # lax = # gndx) in {ax := lax.to-adr(pstate.lnum), err0 := err; gstore[pstate.lnum].gndlist := gstore[pstate.lnum].gndlist + prefixn(# lax, gndx); gstore[pstate.lnum].ladrlist := gstore[pstate.lnum].ladrlist + lax; if err0 ≠ ESUCCESS then ax := ?, pstate := readonly}; isbuf := ?} else abort⟩ (abs-gstore(avol, lpt1, gstore, ginval) ∧ (isbuf → synced(avol)) ∧ pstate = readonly ∧ ax1 = ax ∧ EROFS = err0), dups(log1)
Used simplifier rules: apersistence_add_gnds# (GNDLIST, ROOTADR, ISTORE, ISTORE0, GINVAL, GSTORE0, NL, MAXINO, OS ; ADRLIST, GSTORE, PSTATE, PSYNCED ; ERR ) {if PSTATE.journal? ∨ PSTATE = readonly then if PSTATE = readonly then ERR := EROFS else {choose LADRLIST, ERR0 with (⌊ERR0⌋ ∨ ERR0 = ESUCCESS) ∧ ¬ dups(GSTORE[PSTATE.lnum].ladrlist + LADRLIST) ∧ # LADRLIST ≤ # GNDLIST ∧ inv-flashsize (prefixn(# LADRLIST, GNDLIST), LADRLIST) ∧ (ERR0 = ESUCCESS ↔ # LADRLIST = # GNDLIST) in {ADRLIST := LADRLIST.to-adr(PSTATE.lnum), ERR := ERR0; GSTORE[PSTATE.lnum].gndlist := GSTORE[PSTATE.lnum].gndlist + prefixn(# LADRLIST, GNDLIST); GSTORE[PSTATE.lnum].ladrlist := GSTORE[PSTATE.lnum].ladrlist + LADRLIST; if ERR ≠ ESUCCESS then ADRLIST := ?, PSTATE := readonly}; PSYNCED := ?} else abort };