| author | wenzelm |
| Tue, 11 Dec 2001 15:36:28 +0100 | |
| changeset 12464 | f9d3c92eae4d |
| parent 9541 | d17c0b34d5c8 |
| child 15136 | 1275417e3930 |
| permissions | -rw-r--r-- |
| 9541 | 1 |
theory ToyList = PreList: |
| 8751 | 2 |
|
3 |
datatype 'a list = Nil ("[]")
|
|
| 9541 | 4 |
| Cons 'a "'a list" (infixr "#" 65) |
| 8751 | 5 |
|
6 |
consts app :: "'a list => 'a list => 'a list" (infixr "@" 65) |
|
| 9541 | 7 |
rev :: "'a list => 'a list" |
| 8751 | 8 |
|
9 |
primrec |
|
10 |
"[] @ ys = ys" |
|
| 9541 | 11 |
"(x # xs) @ ys = x # (xs @ ys)" |
| 8751 | 12 |
|
13 |
primrec |
|
14 |
"rev [] = []" |
|
| 9541 | 15 |
"rev (x # xs) = (rev xs) @ (x # [])" |