| # x0 = n0 + # z, n0 = m + 1, x0 = firstn(m, x0) + a ' + z, # z ≤ # x0, x0 = firstn(# x0 - 1 + # z, x0) + a ' + z → firstn(n0, x0).butlast = firstn(# x0 - 1 + # z, x0) ⊦ (a0 ' + firstn(n0, x0)).butlast = a0 ' + firstn(m, x0), n0 = 0 |
# x0 = (m + 1) + # z, x0 = firstn(m, x0) + a ' + z, # z ≤ # x0, x0 = firstn(# x0 - 1 + # z, x0) + a ' + z → (x0.head ' + firstn(m, x0.tail)).butlast = firstn(# x0 - 1 + # z, x0) ⊦ (x0.head ' + firstn(m, x0.tail)).butlast = firstn(m, x0)
Used simplifier rules: firstN-rec: ⊦ firstn(n + 1, x) = x.head + firstn(n, x.tail);% ⊦ x + y = x + z ↔ y = z; (s)% ⊦ (x + a ' + y).butlast = x + (a ' + y).butlast; (s)%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ a + x = a ' + x; (s)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m + 1 ≠ 0; (s)