[Imprint][Data Privacy Statement][E-Mail]



View long theorem info. View the proof. Back to main index. View the specification. View theorem base summary, View theorem base listing, the used properties by spec, the dependency list, the symbol table,

Proof step 5 from proof correctness (previous step)

A.cols = B.rows, m = 0, C = A.rows × B.cols ⊦ ⟨while m < C.rows do {/* (correctness invariant: m ≤ C.rows ∧ C.rows = A.rows ∧ C.cols = B.cols ∧ (∀ m0, n0. m0 < C.rows ∧ n0 < C.cols → C[m0, n0] = (C`)[m0, n0] + (m0 < m ∧ n0 < C.cols ⊃ Σ(B.rows, λ k. A[m0, k] * B[k, n0]);0)) wfbound: C.rows - m) */; let k = 0 in while k < B.rows do {/* (correctness invariant: k ≤ B.rows ∧ C.rows = A.rows ∧ C.cols = B.cols ∧ (∀ m0, n0. m0 < C.rows ∧ n0 < C.cols → C[m0, n0] = (C`)[m0, n0] + (m0 = m ∧ n0 < C.cols ⊃ Σ(k, λ k. A[m0, k] * B[k, n0]);0)) wfbound: B.rows - k) */; let n = 0 in while n < C.cols do {/* (correctness invariant: n ≤ C.cols ∧ C.rows = A.rows ∧ C.cols = B.cols ∧ (∀ m0, n0. m0 < C.rows ∧ n0 < C.cols → C[m0, n0] = (C`)[m0, n0] + (m0 = m ∧ n0 < n ⊃ A[m0, k] * B[k, n0];0)) wfbound: C.cols - n) */; C[m, n] := C[m, n] + A[m, k] * B[k, n]; n := n + 1}; k := k + 1}; m := m + 1}⟩ (C = A * B)

Heuristic symbolic execution applied rule invariant right

And obtained the following new goals

Rule argument

bound: C.rows - m inv: m ≤ C.rows ∧ C.rows = A.rows ∧ C.cols = B.cols ∧ (∀ m0, n0. m0 < C.rows ∧ n0 < C.cols → C[m0, n0] = (C`)[m0, n0] + (m0 < m ∧ n0 < C.cols ⊃ Σ(B.rows, λ k. A[m0, k] * B[k, n0]) ;0 )) fmapos: right 1

Additional information

Used simplifier rules: rows-base: ⊦ (m × n).rows = m; from specification matrix%lez: ⊦ 0 ≤ m; from specification nat%cols-base: ⊦ (m × n).cols = n; from specification matrix%at-base: ⊦ m0 < m ∧ n0 < n → (m × n)[m0, n0] = 0; from specification matrix%zero-01: ⊦ ¬ m < 0; from specification nat-basic1%add-a: ⊦ i + j + i0 = (i + j) + i0; from specification int-basic2%add-c: ⊦ i + j = j + i; from specification int-basic2 Used formulas: m ≤ C.rows ∧ C.rows = A.rows ∧ C.cols = B.cols ∧ (∀ m0, n0. m0 < C.rows ∧ n0 < C.cols → C[m0, n0] = (C`)[m0, n0] + (m0 < m ∧ n0 < C.cols ⊃ Σ(B.rows, λ k. A[m0, k] * B[k, n0]) ;0 )), C.rows - m = C.rows - m