| # buf1 = n2 + n1 + m, n0 + m ≤ # buf0, n1 + m ≤ # buf1 ⊦ # ⌜copy(buf0, n0, buf1, n1, m)⌝ = #((⌜buf1⌝ to n1) + ((⌜buf0⌝ from n0) to m) + (⌜buf1⌝ from n1 + m)) ∧ (∀ n. ⌜n⌝ < # ⌜copy(buf0, n0, buf1, n1, m)⌝ → ⌜copy(buf0, n0, buf1, n1, m)⌝ [n] = ((⌜buf1⌝ to n1) + ((⌜buf0⌝ from n0) to m) + (⌜buf1⌝ from n1 + m))[n]) |
# buf1 = n2 + n1 + m, n1 + m ≤ # buf1, n0 + m ≤ # buf0 ⊦ ⌜# buf1⌝ = ⌜n1⌝ + #((⌜buf0⌝ from n0) to m) + #(⌜buf1⌝ from n1 + m) ∧ (n < # buf1 → ⌜copy(buf0, n0, buf1, n1, m)⌝ [n] = ((⌜buf1⌝ to n1) + ((⌜buf0⌝ from n0) to m) + (⌜buf1⌝ from n1 + m))[n])
Used simplifier rules: append-assoc: ⊦ (σ0 + σ3) + σ4 = σ0 + σ3 + σ4; from specification stream[buffer-inf]%¬ # σ0 < ⌜n⌝ ⊦ #(σ0 to n) = ⌜n⌝ ; (s)% ⊦ m + m0 < n → ¬ n + n0 < m; (s)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m < n → n ≠ 0; (s)%lf-02: ⊦ m < n ∧ m = n0 → n0 < n; (forward) from specification nat-basic%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic%fle-01: ⊦ m ≤ n ∧ n < n0 → m < n0; (forward) from specification nat% ⊦ ⌜m⌝ < ⌜n⌝ ↔ m < n; (s)% ⊦ #(σ0 + σ2) = # σ0 + # σ2; (s)% ⊦ # copy(buf, m, buf0, m0, n) = # buf0; (s)% ⊦ # ⌜buf⌝ = ⌜# buf⌝ ; (s)