author | wenzelm |
Thu, 02 Apr 2020 20:37:11 +0200 | |
changeset 71668 | 25ef5c7287a7 |
parent 58926 | baf5a3c28f0c |
permissions | -rw-r--r-- |
theory ToyList imports Main begin no_notation Nil ("[]") and Cons (infixr "#" 65) and append (infixr "@" 65) hide_type list hide_const rev datatype 'a list = Nil ("[]") | Cons 'a "'a list" (infixr "#" 65) (* This is the append function: *) primrec app :: "'a list => 'a list => 'a list" (infixr "@" 65) where "[] @ ys = ys" | "(x # xs) @ ys = x # (xs @ ys)" primrec rev :: "'a list => 'a list" where "rev [] = []" | "rev (x # xs) = (rev xs) @ (x # [])"