doc-src/Tutorial/ToyList/ToyList.thy
author wenzelm
Mon, 28 Aug 2000 20:28:44 +0200
changeset 9701 533df6cedc2d
parent 5377 efb799c5ed3c
permissions -rw-r--r--
* \isabellestyle{it} produces near math mode output; * settings: smart setup of canonical ML_HOME, ISABELLE_INTERFACE, XSYMBOL_HOME;

ToyList = Datatype +

datatype 'a list = Nil                        ("[]")
                 | Cons 'a ('a list)          (infixr "#" 65)

consts app :: 'a list => 'a list => 'a list   (infixr "@" 65)
       rev :: 'a list => 'a list

primrec
"[] @ ys       = ys"
"(x # xs) @ ys = x # (xs @ ys)"

primrec
"rev []        = []"
"rev (x # xs)  = (rev xs) @ (x # [])"

end