| violations(a + x0) = m + 1, n + 1 < #(a + x0), (a + x0)[n + 1] < (a + x0)[n], ∀ m, n. violations(x0) = m + 1 ∧ x0[n + 1] < x0[n] ∧ n + 1 < # x0 → violations(x0[n, x0[n + 1]][n + 1, x0[n]]) = m ∨ x0 = [] ⊦ a + x0 = [], violations((a + x0)[n, (a + x0)[n + 1]][n + 1, (a + x0)[n]]) = m |
less#(a, x0) + violations(x0) = m + 1, n < # x0, x0[n] < (a ' + x0)[n], ∀ m0, n0. violations(x0) = m0 + 1 ∧ x0[n0 + 1] < x0[n0] ∧ n0 + 1 < # x0 → violations(x0[n0, x0[n0 + 1]][n0 + 1, x0[n0]]) = m0 ⊦ violations((a ' + x0)[n, x0[n]][n + 1, (a ' + x0)[n]]) = m, x0 = []
Used simplifier rules: violations-rec: ⊦ violations(a ' + x) = less#(a, x) + violations(x);% ⊦ # x = 0 ↔ x = []; (s)%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic% ⊦ m + n < m + n0 ↔ n < n0; (s)% ⊦ m +1 = m + 1; (s)% ⊦ #(a ' + x) = (# x)+1; (s)% ⊦ a ' + x ≠ []; (s)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ (a ' + x)[n + 1] = x[n]; (s)%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ a + x = a ' + x; (s)