Go backward to Structural Induction Go up to Top Go forward to Example (Continued) |
Take the set List(T) defined inductively as
We define
nil in List(T), forall e in T, l in List(T): cons(e, l) in List(T).
and claim that the following holds:
append: List(T) x List(T) -> List(T) append(nil, y) := y append(cons(e, x), y) := cons(e, append(x, y))
forall x in List(T), y in List(T): length(append(x, y)) = length(x)+length(y).