| # y = n, x = y + z, n ≤ # x ⊦ n = 0, z = (x = [] ⊃ [];restn(n - 1, x.tail)) |
⊦ y = [], z = (y + z = [] ⊃ [];restn(# y - 1, y.tail + z))
Used simplifier rules: c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m ≤ m + n; (s)% ⊦ #(x + y) = # x + # y; (s)%a: ⊦ (x + y) + z = x + y + z; from specification list% ⊦ x ≠ [] → (x + y).tail = x.tail + y; (s)% ⊦ # x = 0 ↔ x = []; (s)