| adr = @(pstate.lnum, maxino, ind.flashsize), adr0 = adr1, adr2 = adr, adr3 = adr4, err0 = ESUCCESS, err0 = err, err1 = err0, ginval = ∅, ginval0 = ∅, ginval1 = ∅, ginval2 = ∅, gstore = ∅, gstore0 = ∅, gstore1 = ∅, gstore2 = ∅, ind = indexnode(mkbrarray(BRANCH_SIZE), true, 0), istore = istore1[pstate.lnum, istore1[pstate.lnum].indlist:= (istore1[pstate.lnum].indlist + ind)] [pstate.lnum, istore1[pstate.lnum, istore1[pstate.lnum].indlist:= (istore1[pstate.lnum].indlist + ind)][pstate.lnum] .ladrlist:= (istore1[pstate.lnum, istore1[pstate.lnum].indlist:= (istore1[pstate.lnum].indlist + ind)][pstate.lnum].ladrlist + @(adr.pos, adr.size)) ], istore0 = ∅, istore1 = (∅)[n, indexblock([], [], 0)], istore2 = ∅, maxino0 = maxino4, maxino1 = maxino4, nx = [], nx0 = [], pstate = index(n), syn0, inv((∅)[n, indexblock([], [], 0)]), inv(istore), pstate.lnum ∈ istore1[pstate.lnum, istore1[pstate.lnum].indlist:= (istore1[pstate.lnum].indlist + ind)], pstate.lnum ∈ istore1, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize ≤ LEB_SIZE, pstate = unbuffered → syn, pstate.index? → pstate.lnum ∈ istore, ¬ @(pstate.lnum, maxino, ind.flashsize) ∈ istore1 ∧ err = ESUCCESS ∨ ⌊err⌋ , pstate.index? ∨ pstate.journal? ⊦ ⟪apersistence_set_iblock_refsize# (adr2.lnum, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize, adr1, istore0, ginval0, gstore0, gstore, nx, maxino1, ginval, pstate, syn; istore); if err1 = ESUCCESS then apersistence_sync#(adr1, istore, istore0, ginval0, gstore0, gstore, nx, maxino1, ginval; pstate, syn; err1); if err1 = ESUCCESS then let ns = ∅ in apersistence_commit#(adr2, maxino4, syn; ns, istore, ginval0, gstore0, adr1, istore0, gstore, nx, maxino1, ginval; pstate, err1)⟫ ( ( err1 = ESUCCESS → syn ∧ (∃ ri, fi. btree-inv(null, adr1, istore, istore0, 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(istore) ∧ inv(istore0) ∧ istore0 ⊑ istore ∧ remove-refsize0(istore0) = istore0 ∧ (pstate.journal? → nx ≠ [] ∧ pstate.lnum = nx.last ∧ pstate.lnum ∈ gstore0) ∧ (pstate.index? → pstate.lnum ∈ istore)) ∧ (err1 = ESUCCESS ∨ ⌊err1⌋ ) ∧ (err1 = ESUCCESS → btree-inv(null, adr1, istore, istore0, zh, ∅, ∅) ∧ gstore0 = ∅ ∧ ginval0 = ∅ ∧ maxino1 = maxino4 ∧ nx = [] ∧ ginval = ∅)), pstate.journal? |
istore = (∅)[n, indexblock(indexnode(mkbrarray(BRANCH_SIZE), true, 0) ', @(maxino, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize) ', 0)], inv((∅)[n, indexblock([], [], 0)]), inv((∅)[n, indexblock(indexnode(mkbrarray(BRANCH_SIZE), true, 0) ', @(maxino, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize) ', 0)]), indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize ≤ LEB_SIZE ⊦ ⟪apersistence_set_iblock_refsize# (index(n).lnum, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize, adr1, ∅, ∅, ∅, ∅, [], maxino4, ∅, index(n), syn; istore); pstate := index(n); nx := []; maxino1 := maxino4; istore0 := ∅; gstore0 := ∅; gstore := ∅; ginval0 := ∅; ginval := ∅; err := ESUCCESS; if err = ESUCCESS then apersistence_sync#(adr1, istore, istore0, ginval0, gstore0, gstore, nx, maxino1, ginval; pstate, syn; err); if err = ESUCCESS then let ns = ∅ in apersistence_commit# (@(index(n).lnum, maxino, indexnode(mkbrarray(BRANCH_SIZE), true, 0).flashsize), maxino4, syn ; ns, istore, ginval0, gstore0, adr1, istore0, gstore, nx, maxino1, ginval ; pstate, err)⟫ ( ( err = ESUCCESS → syn ∧ (∃ ri, fi. btree-inv(null, adr1, istore, istore0, 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(istore) ∧ inv(istore0) ∧ istore0 ⊑ istore ∧ remove-refsize0(istore0) = istore0 ∧ (pstate.journal? → nx ≠ [] ∧ pstate.lnum = nx.last ∧ pstate.lnum ∈ gstore0) ∧ (pstate.index? → pstate.lnum ∈ istore)) ∧ (err = ESUCCESS ∨ ⌊err⌋ ) ∧ (err = ESUCCESS → btree-inv(null, adr1, istore, istore0, zh, ∅, ∅) ∧ gstore0 = ∅ ∧ ginval0 = ∅ ∧ maxino1 = maxino4 ∧ nx = [] ∧ ginval = ∅))
Used simplifier rules: ⊦ @(m, m0, m1).lnum = m; (s)% ⊦ unbuffered ≠ index(m); (s)% ⊦ ¬ ladr ∈ []; (s)% ⊦ @(n, n0, n1) ∈ istore[n, iblock] ↔ @(n0, n1) ∈ iblock.ladrlist; (s)% ⊦ index(m).index?; (s)% ⊦ ¬ index(m).journal?; (s)% ⊦ n ∈ istore[n, iblock]; (s)%⊦ indexblock(indx, lax, m).ladrlist:= lax0 = indexblock(indx, lax0, m); (s)%a: ⊦ (lax + lax0) + lax1 = lax + lax0 + lax1; from specification list[laddress-list]% ⊦ [] + lax = lax; (s)% ⊦ lax + ladr = lax + ladr '; (s)% ⊦ @(m, m0, m1).size = m1; (s)% ⊦ @(m, m0, m1).pos = m0; (s)% ⊦ indexblock(indx, lax, m).ladrlist = lax; (s)% ⊦ istore[n, iblock][n, iblock0] = istore[n, iblock0]; (s)%⊦ indexblock(indx, lax, m).indlist:= indx0 = indexblock(indx0, lax, m); (s)%a: ⊦ (indx + indx0) + indx1 = indx + indx0 + indx1; from specification list[index-store]% ⊦ [] + indx = indx; (s)% ⊦ indx + ind = indx + ind '; (s)% ⊦ indexblock(indx, lax, m).indlist = indx; (s)% ⊦ istore[n, iblock][n] = iblock; (s)% ⊦ index(m).lnum = m; (s)