| syn0 ↔ true, adr1 = adr, ginval1 = ∅, ginval2 = ∅, gstore1 = ∅, gstore2 = ∅, istore0 = ∅, istore1 = ∅, maxino0 = maxino4, nx0 = [], pstate = unbuffered, inv-index(istore0, ∅), inv-journal([], ∅, ∅, ∅), inv-state(pstate, [], ∅, istore0, true), indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize ≤ LEB_SIZE ⊦ [apersistence_allocate_ind#(adr, ∅, ∅, ∅, ∅, [], maxino4, ∅, true; istore0, pstate; err0)] ( inv-index(istore0, istore1) ∧ inv-state(pstate, nx0, gstore1, istore0, syn0) → ⟪nx := []; maxino := maxino4; istore := ∅; ind := indexnode(mkbrarray(BRANCH_SIZE), true, 0); gstore0 := ∅; gstore := ∅; ginval0 := ∅; ginval := ∅; syn := true; if err0 = ESUCCESS then apersistence_add_ind#(ind, adr, istore, ginval0, gstore0, gstore, nx, maxino, ginval; adr0, istore0, pstate, syn; err0); if err0 = ESUCCESS then apersistence_set_iblock_refsize# (adr0.lnum, ind.flashsize, adr, istore, ginval0, gstore0, gstore, nx, maxino, ginval, pstate, syn; istore0); if err0 = ESUCCESS then apersistence_sync#(adr, istore0, istore, ginval0, gstore0, gstore, nx, maxino, ginval; pstate, syn; err0); if err0 = ESUCCESS then let ns = ∅ in apersistence_commit#(adr0, maxino4, syn; ns, istore0, ginval0, gstore0, adr, istore, gstore, nx, maxino, ginval; pstate, err0)⟫ ( ( err0 = ESUCCESS → syn ∧ (∃ ri, fi. btree-inv(null, adr, istore0, istore, zh, ri, fi)) ∧ inv(gstore0 \ ginval0) ∧ inv(gstore) ∧ elems nx ∩ ginval0 = ∅ ∧ ¬ dups(nx) ∧ dom gstore ∪ elems nx = dom gstore0 ∪ ginval0 ∧ remove-refsize0(gstore) = gstore ∧ inv(istore0) ∧ inv(istore) ∧ istore ⊑ istore0 ∧ remove-refsize0(istore) = istore ∧ (pstate.journal? → nx ≠ [] ∧ pstate.lnum = nx.last ∧ pstate.lnum ∈ gstore0) ∧ (pstate.index? → pstate.lnum ∈ istore0)) ∧ (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ (err0 = ESUCCESS → btree-inv(null, adr, istore0, istore, zh, ∅, ∅) ∧ gstore0 = ∅ ∧ ginval0 = ∅ ∧ maxino = maxino4 ∧ nx = [] ∧ ginval = ∅))) |
istore0 = ∅, pstate = unbuffered, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize ≤ LEB_SIZE ⊦ [apersistence_allocate_ind#(adr, ∅, ∅, ∅, ∅, [], maxino4, ∅, true; istore0, pstate; err0)] ( inv(istore0) ∧ ¬ pstate.journal? ∧ (pstate.index? → pstate.lnum ∈ istore0) → ⟪nx := []; maxino := maxino4; istore := ∅; ind := indexnode(mkbrarray(BRANCH_SIZE), true, 0); gstore0 := ∅; gstore := ∅; ginval0 := ∅; ginval := ∅; syn := true; if err0 = ESUCCESS then apersistence_add_ind#(ind, adr, istore, ginval0, gstore0, gstore, nx, maxino, ginval; adr0, istore0, pstate, syn; err0); if err0 = ESUCCESS then apersistence_set_iblock_refsize# (adr0.lnum, ind.flashsize, adr, istore, ginval0, gstore0, gstore, nx, maxino, ginval, pstate, syn; istore0); if err0 = ESUCCESS then apersistence_sync#(adr, istore0, istore, ginval0, gstore0, gstore, nx, maxino, ginval; pstate, syn; err0); if err0 = ESUCCESS then let ns = ∅ in apersistence_commit#(adr0, maxino4, syn; ns, istore0, ginval0, gstore0, adr, istore, gstore, nx, maxino, ginval; pstate, err0)⟫ ( ( err0 = ESUCCESS → syn ∧ (∃ ri, fi. btree-inv(null, adr, istore0, istore, zh, ri, fi)) ∧ inv(gstore0 \ ginval0) ∧ inv(gstore) ∧ elems nx ∩ ginval0 = ∅ ∧ ¬ dups(nx) ∧ dom gstore ∪ elems nx = dom gstore0 ∪ ginval0 ∧ remove-refsize0(gstore) = gstore ∧ inv(istore0) ∧ inv(istore) ∧ istore ⊑ istore0 ∧ remove-refsize0(istore) = istore ∧ (pstate.journal? → nx ≠ [] ∧ pstate.lnum = nx.last ∧ pstate.lnum ∈ gstore0) ∧ (pstate.index? → pstate.lnum ∈ istore0)) ∧ (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ (err0 = ESUCCESS → btree-inv(null, adr, istore0, istore, zh, ∅, ∅) ∧ gstore0 = ∅ ∧ ginval0 = ∅ ∧ maxino = maxino4 ∧ nx = [] ∧ ginval = ∅)))
Used simplifier rules: ⊦ remove-refsize0(∅) = ∅; (s)% ⊦ ∅ ⊑ istore; (s)% ⊦ inv(∅); (s)%⊦ inv-index(istore, istore0) ↔ inv(istore) ∧ inv(istore0) ∧ istore0 ⊑ istore ∧ remove-refsize0(istore0) = istore0; (s)% ⊦ remove-refsize0(∅) = ∅; (s)%unc: ⊦ ns ∪ ns0 = ns0 ∪ ns; from specification set-union[nat-set]%una: ⊦ (ns ∪ ns0) ∪ ns1 = ns ∪ ns0 ∪ ns1; from specification set-union[nat-set]% ⊦ ns ∪ ∅ = ns; (s)% ⊦ dom ∅ = ∅; (s)% ⊦ ¬ dups([]); (s)%int-c: ⊦ ns ∩ ns0 = ns0 ∩ ns; from specification set-union[nat-set]%int-a: ⊦ (ns ∩ ns0) ∩ ns1 = ns ∩ ns0 ∩ ns1; from specification set-union[nat-set]% ⊦ ns ∩ ∅ = ∅; (s)% ⊦ elems [] = ∅; (s)% ⊦ inv(∅); (s)% ⊦ ∅ \ ns = ∅; (s)%⊦ inv-journal(nx, gstore, gstore0, ginval) ↔ inv(gstore \ ginval) ∧ inv(gstore0) ∧ elems nx ∩ ginval = ∅ ∧ ¬ dups(nx) ∧ dom gstore0 ∪ elems nx = dom gstore ∪ ginval ∧ remove-refsize0(gstore0) = gstore0; (s)% ⊦ ¬ unbuffered.index?; (s)% ⊦ ¬ unbuffered.journal?; (s)%⊦ inv-state(pstate, nx, gstore, istore, syn) ↔ ( pstate.journal? → nx ≠ [] ∧ pstate.lnum = nx.last ∧ pstate.lnum ∈ gstore) ∧ (pstate.index? → pstate.lnum ∈ istore) ∧ (pstate = unbuffered → syn); (s)