# HG changeset patch # User haftmann # Date 1224677743 -7200 # Node ID a287d0e8aa9d446e72a75d6c2a9c3fff823afeb5 # Parent 54091ba1448ffae603ad4cb300d94664509ddebb slightly tuned diff -r 54091ba1448f -r a287d0e8aa9d src/HOL/Code_Eval.thy --- a/src/HOL/Code_Eval.thy Wed Oct 22 14:15:42 2008 +0200 +++ b/src/HOL/Code_Eval.thy Wed Oct 22 14:15:43 2008 +0200 @@ -15,14 +15,10 @@ datatype "term" = dummy_term -definition - Const :: "message_string \ typerep \ term" -where +definition Const :: "message_string \ typerep \ term" where "Const _ _ = dummy_term" -definition - App :: "term \ term \ term" -where +definition App :: "term \ term \ term" where "App _ _ = dummy_term" code_datatype Const App diff -r 54091ba1448f -r a287d0e8aa9d src/HOL/Int.thy --- a/src/HOL/Int.thy Wed Oct 22 14:15:42 2008 +0200 +++ b/src/HOL/Int.thy Wed Oct 22 14:15:43 2008 +0200 @@ -21,9 +21,7 @@ subsection {* The equivalence relation underlying the integers *} -definition - intrel :: "((nat \ nat) \ (nat \ nat)) set" -where +definition intrel :: "((nat \ nat) \ (nat \ nat)) set" where [code del]: "intrel = {((x, y), (u, v)) | x y u v. x + v = u +y }" typedef (Integ) diff -r 54091ba1448f -r a287d0e8aa9d src/HOL/ex/Efficient_Nat_examples.thy --- a/src/HOL/ex/Efficient_Nat_examples.thy Wed Oct 22 14:15:42 2008 +0200 +++ b/src/HOL/ex/Efficient_Nat_examples.thy Wed Oct 22 14:15:43 2008 +0200 @@ -9,34 +9,24 @@ imports Main "~~/src/HOL/Real/RealDef" Efficient_Nat begin -fun - to_n :: "nat \ nat list" -where +fun to_n :: "nat \ nat list" where "to_n 0 = []" | "to_n (Suc 0) = []" | "to_n (Suc (Suc 0)) = []" | "to_n (Suc n) = n # to_n n" -definition - naive_prime :: "nat \ bool" -where +definition naive_prime :: "nat \ bool" where "naive_prime n \ n \ 2 \ filter (\m. n mod m = 0) (to_n n) = []" -primrec - fac :: "nat \ nat" -where +primrec fac :: "nat \ nat" where "fac 0 = 1" | "fac (Suc n) = Suc n * fac n" -primrec - rat_of_nat :: "nat \ rat" -where +primrec rat_of_nat :: "nat \ rat" where "rat_of_nat 0 = 0" | "rat_of_nat (Suc n) = rat_of_nat n + 1" -primrec - harmonic :: "nat \ rat" -where +primrec harmonic :: "nat \ rat" where "harmonic 0 = 0" | "harmonic (Suc n) = 1 / rat_of_nat (Suc n) + harmonic n"