diff -r 5c317e8f5673 -r f14305fb698c src/HOL/List.thy --- a/src/HOL/List.thy Thu Dec 06 15:10:12 2007 +0100 +++ b/src/HOL/List.thy Thu Dec 06 16:36:19 2007 +0100 @@ -104,11 +104,11 @@ "map f [] = []" "map f (x#xs) = f(x)#map f xs" -setup {* snd o Sign.declare_const [] (*authentic syntax*) - ("append", @{typ "'a list \ 'a list \ 'a list"}, InfixrName ("@", 65)) *} primrec - append_Nil:"[]@ys = ys" - append_Cons: "(x#xs)@ys = x#(xs@ys)" + append :: "'a list \ 'a list \ 'a list" (infixr "@" 65) +where + append_Nil:"[] @ ys = ys" + | append_Cons: "(x#xs) @ ys = x # xs @ ys" primrec "rev([]) = []" @@ -222,11 +222,11 @@ "sorted [x] \ True" | "sorted (x#y#zs) \ x <= y \ sorted (y#zs)" -fun insort :: "'a \ 'a list \ 'a list" where +primrec insort :: "'a \ 'a list \ 'a list" where "insort x [] = [x]" | "insort x (y#ys) = (if x <= y then (x#y#ys) else y#(insort x ys))" -fun sort :: "'a list \ 'a list" where +primrec sort :: "'a list \ 'a list" where "sort [] = []" | "sort (x#xs) = insort x (sort xs)" @@ -3172,11 +3172,11 @@ filtermap :: "('a \ 'b option) \ 'a list \ 'b list" map_filter :: "('a \ 'b) \ ('a \ bool) \ 'a list \ 'b list" -setup {* snd o Sign.declare_const [] (*authentic syntax*) - ("member", @{typ "'a \ 'a list \ bool"}, InfixlName ("mem", 55)) *} primrec - "x mem [] = False" - "x mem (y#ys) = (if y=x then True else x mem ys)" + member :: "'a \ 'a list \ bool" (infixl "mem" 55) +where + "x mem [] \ False" + | "x mem (y#ys) \ (if y = x then True else x mem ys)" primrec "null [] = True"