| n0 + n1 ≤ # x0 + 1, ∀ n, n0, n1. n + n0 + n1 ≤ # x0 → firstn(n0, restn(n, x0)) + firstn(n1, restn(n + n0, x0)) = firstn(n0 + n1, restn(n, x0)) ⊦ firstn(n0, a ' + x0) + firstn(n1, restn(n0, a ' + x0)) = firstn(n0 + n1, a ' + x0) |
n ≠ 0 ⊦ firstn((* n), x) = x.first ' + firstn(n -1, x.rest)
n0 + n1 ≠ 0, n0 + n1 ≤ # x0 + 1, ∀ n, n0, n1. n + n0 + n1 ≤ # x0 → firstn(n0, restn(n, x0)) + firstn(n1, restn(n + n0, x0)) = firstn(n0 + n1, restn(n, x0)) ⊦ firstn(n0, a ' + x0) + firstn(n1, restn(n0, a ' + x0)) = (a ' + x0).first ' + firstn((n0 + n1)-1, (a ' + x0).rest)
Used simplifier rules: firstN-zero: ⊦ firstn(0, x) = [];%restN-zero: ⊦ restn(0, x) = x;%z-01: ⊦ m + n = 0 ↔ m = 0 ∧ n = 0; from specification nat-basic2%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic2%c: ⊦ m + n = n + m; from specification nat-basic2%Nil: ⊦ [] + x = x; from specification list%a: ⊦ (x + y) + z = x + y + z; from specification list Used terms: a ' + x0, n0 + n1