| # x0 + 1 = n0 + m0, ∀ n0, m0. # x0 = n0 + m0 → firstn(m0, x0) + firstn(n0, restn(m0, x0)) = x0 ⊦ firstn(m0, a ' + x0) + firstn(n0, restn(m0, a ' + x0)) = a ' + x0 |
n ≠ 0 ⊦ firstn((* n), x) = x.first ' + firstn(n -1, x.rest)
m0 ≠ 0, # x0 + 1 = n0 + m0, ∀ n0, m0. # x0 = n0 + m0 → firstn(m0, x0) + firstn(n0, restn(m0, x0)) = x0 ⊦ ((a ' + x0).first ' + firstn(m0 -1, (a ' + x0).rest)) + firstn(n0, restn(m0, a ' + x0)) = a ' + x0
Used simplifier rules: firstN-zero: ⊦ firstn(0, x) = [];%restN-zero: ⊦ restn(0, x) = x;%firstN-rec: ⊦ firstn(n + 1, x) = x.first + firstn(n, x.rest);%first-all: ⊦ firstn(# x, x) = x;%add-base: ⊦ n + 0 = n; 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%c-07: ⊦ (a ' + x).rest = x; from specification list%c-08: ⊦ (a ' + x).first = a; from specification list%c: ⊦ a + x = a ' + x; from specification list%app-08: ⊦ a ' + x = a ' + y ↔ x = y; from specification list Used terms: a ' + x0, m0