| 1 + # x0 = 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.head ' + firstn(n -1, x.tail)
1 + # x0 = n0 + m0, ∀ n0, m0. # x0 = n0 + m0 → firstn(m0, x0) + firstn(n0, restn(m0, x0)) = x0 ⊦ ((a ' + x0).head ' + firstn(m0 -1, (a ' + x0).tail)) + firstn(n0, restn(m0, a ' + x0)) = a ' + x0, m0 = 0
Used simplifier rules: firstN-zero: ⊦ firstn(0, x) = [];%restN-zero: ⊦ restn(0, x) = x;%firstN-rec: ⊦ firstn(n + 1, x) = x.head + firstn(n, x.tail);%first-all: ⊦ firstn(# x, x) = x;% ⊦ 0 + m = m; (s)%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic%c: ⊦ m + n = n + m; from specification nat-basic% ⊦ [] + x = x; (s)%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ (a ' + x).head = a; (s)% ⊦ (a ' + x).tail = x; (s)% ⊦ a + x = a ' + x; (s)% ⊦ x + y = x + z ↔ y = z; (s) Used terms: a ' + x0, m0