author | nipkow |
Mon, 16 Aug 2004 19:47:01 +0200 | |
changeset 15136 | 1275417e3930 |
parent 9541 | d17c0b34d5c8 |
child 15141 | a95c2ff210ba |
permissions | -rw-r--r-- |
15136 | 1 |
theory ToyList |
2 |
import PreList |
|
3 |
begin |
|
8751 | 4 |
|
5 |
datatype 'a list = Nil ("[]") |
|
9541 | 6 |
| Cons 'a "'a list" (infixr "#" 65) |
8751 | 7 |
|
8 |
consts app :: "'a list => 'a list => 'a list" (infixr "@" 65) |
|
9541 | 9 |
rev :: "'a list => 'a list" |
8751 | 10 |
|
11 |
primrec |
|
12 |
"[] @ ys = ys" |
|
9541 | 13 |
"(x # xs) @ ys = x # (xs @ ys)" |
8751 | 14 |
|
15 |
primrec |
|
16 |
"rev [] = []" |
|
9541 | 17 |
"rev (x # xs) = (rev xs) @ (x # [])" |