doc-src/TutorialI/Overview/LNCS/FP0.thy
author paulson
Mon, 01 Sep 2003 15:07:43 +0200
changeset 14179 04f905c13502
parent 13439 2f98365f57a8
child 16417 9bc16273c2d4
permissions -rw-r--r--
Corrections due to John Matthews

theory FP0 = PreList:

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

consts app :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list"   (infixr "@" 65)
       rev :: "'a list \<Rightarrow> 'a list"

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

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

theorem rev_rev [simp]: "rev(rev xs) = xs"
(*<*)oops(*>*)text_raw{*\isanewline\isanewline*}

end