diff -r 3950e65f48f8 -r 65fe827aa595 src/HOL/ex/Codegenerator.thy --- a/src/HOL/ex/Codegenerator.thy Tue Sep 19 15:22:03 2006 +0200 +++ b/src/HOL/ex/Codegenerator.thy Tue Sep 19 15:22:05 2006 +0200 @@ -27,8 +27,6 @@ definition swap :: "'a * 'b \ 'b * 'a" "swap p = (let (x, y) = p in (y, x))" - swapp :: "'a * 'b \ 'c * 'd \ ('a * 'c) * ('b * 'd)" - "swapp = (\(x, y) (z, w). ((x, z), (y, w)))" appl :: "('a \ 'b) * 'a \ 'b" "appl p = (let (f, x) = p in f x)" @@ -91,8 +89,14 @@ h "Mymod.A.B.f" code_gen xor -code_gen one "0::nat" "1::nat" -code_gen "0::int" "1::int" n fac +code_gen one +code_gen "0::int" "1::int" + (SML) (Haskell) +code_gen n + (SML) (Haskell) +code_gen fac + (SML) (Haskell) +code_gen n (SML) (Haskell) code_gen "op + :: nat \ nat \ nat" @@ -101,7 +105,9 @@ "op < :: nat \ nat \ bool" "op <= :: nat \ nat \ bool" code_gen - Pair fst snd Let split swap swapp appl + Pair fst snd Let split swap +code_gen + appl code_gen k "op + :: int \ int \ int" @@ -122,43 +128,31 @@ code_gen mut1 mut2 code_gen - "op @" filter concat foldl foldr hd tl - last butlast list_all2 - map - nth - list_update - take - drop - takeWhile - dropWhile - rev - zip - upt - remdups remove1 null - "distinct" replicate rotate1 rotate splice - (SML) (Haskell) +code_gen + remdups + "distinct" code_gen foo1 foo3 code_gen - "op = :: bool \ bool \ bool" - "op = :: nat \ nat \ bool" - "op = :: int \ int \ bool" - "op = :: 'a * 'b \ 'a * 'b \ bool" - "op = :: 'a + 'b \ 'a + 'b \ bool" - "op = :: 'a option \ 'a option \ bool" - "op = :: 'a list \ 'a list \ bool" - "op = :: point \ point \ bool" - "op = :: mut1 \ mut1 \ bool" - "op = :: mut2 \ mut2 \ bool" + "OperationalEquality.eq :: bool \ bool \ bool" + "OperationalEquality.eq :: nat \ nat \ bool" + "OperationalEquality.eq :: int \ int \ bool" + "OperationalEquality.eq :: ('a\eq) * ('b\eq) \ 'a * 'b \ bool" + "OperationalEquality.eq :: ('a\eq) + ('b\eq) \ 'a + 'b \ bool" + "OperationalEquality.eq :: ('a\eq) option \ 'a option \ bool" + "OperationalEquality.eq :: ('a\eq) list \ 'a list \ bool" + "OperationalEquality.eq :: mut1 \ mut1 \ bool" + "OperationalEquality.eq :: mut2 \ mut2 \ bool" + "OperationalEquality.eq :: ('a\eq) point_scheme \ 'a point_scheme \ bool" code_gen f g h -code_gen (SML -) +code_gen (SML -) (SML _) end \ No newline at end of file