| pebs[m3] = mkpeb(buf0, m1, false), m3 < # pebs[m3, pebs[m3].data:= copy(buf, n2, pebs[m3].data, m2, n1)], m3 < # pebs, is-aligned(m2, EB_PAGE_SIZE), is-aligned(n, EB_PAGE_SIZE), is-aligned(n1, EB_PAGE_SIZE), mtd-cons(pebs), m1 ≤ m2, m2 + n ≤ PEB_SIZE, n2 + n ≤ # buf, m2 + n1 ≤ # pebs[m3].data, n2 + n1 ≤ # buf, ⌊err0⌋ ∨ err0 = ESUCCESS, n1 < n ∨ n1 = 0 ∧ n = 0 ⊦ err0 = ESUCCESS, n1 = 0, mtd-cons (pebs[m3, pebs[m3].data:= copy(buf, n2, pebs[m3].data, m2, n1)] [m3, pebs[m3, pebs[m3].data:= copy(buf, n2, pebs[m3].data, m2, n1)][m3].fill:= (m2 + n1) ]) |
# pebs[n0].data = PEB_SIZE, pebs[m3] = mkpeb(buf0, m1, false), n1 < n, n0 < # pebs, m3 < # pebs, is-aligned(m2, EB_PAGE_SIZE), is-aligned(n, EB_PAGE_SIZE), is-aligned(n1, EB_PAGE_SIZE), mtd-cons(pebs), n2 + n1 ≤ # buf, m1 ≤ m2, m2 + n ≤ PEB_SIZE, n2 + n ≤ # buf, m2 + n1 ≤ PEB_SIZE, ⌊err0⌋ , ¬ pebs[n0].bad → pebs[n0].fill ≤ PEB_SIZE ∧ is-aligned(pebs[n0].fill, EB_PAGE_SIZE) ∧ range=(pebs[n0].data, pebs[n0].fill, emptypeb, pebs[n0].fill, PEB_SIZE - pebs[n0].fill) ⊦ n1 = 0, # pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].data = PEB_SIZE ∧ ( ¬ pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].bad → pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].fill ≤ PEB_SIZE ∧ is-aligned(pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].fill, EB_PAGE_SIZE) ∧ range= (pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].data, pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].fill, emptypeb, pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].fill, PEB_SIZE - pebs[m3, mkpeb(copy(buf, n2, buf0, m2, n1), m2 + n1, false)][n0].fill))
Used simplifier rules: reduce-mtd-cons: ⊦ mtd-cons(pebs0) → ( mtd-cons(pebs1) ↔ (∀ n. n < # pebs1 ∧ (n < # pebs0 → mtd-valid-peb(pebs0[n])) → mtd-valid-peb(pebs1[n])));% ⊦ mkpeb(buf, m, boolvar).fill:= m0 = mkpeb(buf, m0, boolvar); (s)% ⊦ mkpeb(buf, m, boolvar).data:= buf0 = mkpeb(buf0, m, boolvar); (s)%n < # pebs ⊦ pebs[n] = mkpeb(buf, m, boolvar) ∧ mtd-cons(pebs) → # buf = PEB_SIZE; (s)% ⊦ mkpeb(buf, m, boolvar).data = buf; (s)% ⊦ m < n → n ≠ 0; (s)%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic% ⊦ ⌊err⌋ → err ≠ ESUCCESS; (s)%⊦ mtd-valid-peb(peb) ↔ # peb.data = PEB_SIZE ∧ ( ¬ peb.bad → peb.fill ≤ PEB_SIZE ∧ is-aligned(peb.fill, EB_PAGE_SIZE) ∧ range= (peb.data, peb.fill, emptypeb, peb.fill, PEB_SIZE - peb.fill)); (s)%m < # pebs ⊦ pebs[m, peb][m, peb0] = pebs[m, peb0]; (s)% ⊦ m < n → (n ≤ m ↔ false); (s)% ⊦ m < n ↔ ¬ n ≤ m; (ss)% ⊦ m < # pebs → pebs[m, peb][m] = peb; (s)% ⊦ # pebs[n, peb] = # pebs; (s)