24195
|
1 |
(* Title: HOL/ex/Codegenerator_Pretty.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Florian Haftmann, TU Muenchen
|
|
4 |
*)
|
|
5 |
|
|
6 |
header {* Simple examples for pretty numerals and such *}
|
|
7 |
|
|
8 |
theory Codegenerator_Pretty
|
25963
|
9 |
imports ExecutableContent Code_Char Efficient_Nat
|
24195
|
10 |
begin
|
|
11 |
|
26022
|
12 |
setup {*
|
|
13 |
Code.del_funcs
|
|
14 |
(AxClass.param_of_inst @{theory} (@{const_name "Eval.term_of"}, @{type_name "index"}))
|
|
15 |
#> Code.del_funcs
|
|
16 |
(AxClass.param_of_inst @{theory} (@{const_name "Eval.term_of"}, @{type_name "char"}))
|
|
17 |
#> Code.del_funcs
|
|
18 |
(AxClass.param_of_inst @{theory} (@{const_name "Eval.term_of"}, @{type_name "int"}))
|
|
19 |
#> Code.del_funcs
|
|
20 |
(AxClass.param_of_inst @{theory} (@{const_name "Eval.term_of"}, @{type_name "nat"}))
|
|
21 |
*}
|
25933
|
22 |
|
25963
|
23 |
declare char.recs [code func del]
|
|
24 |
char.cases [code func del]
|
|
25 |
char.size [code func del]
|
24195
|
26 |
|
25963
|
27 |
declare isnorm.simps [code func del]
|
25933
|
28 |
|
25963
|
29 |
ML {* (*FIXME get rid of this*)
|
|
30 |
nonfix union;
|
|
31 |
nonfix inter;
|
|
32 |
nonfix upto;
|
|
33 |
*}
|
25933
|
34 |
|
25963
|
35 |
export_code * in SML module_name CodegenTest
|
|
36 |
in OCaml module_name CodegenTest file -
|
|
37 |
in Haskell file -
|
25616
|
38 |
|
25963
|
39 |
ML {*
|
|
40 |
infix union;
|
|
41 |
infix inter;
|
|
42 |
infix 4 upto;
|
|
43 |
*}
|
24195
|
44 |
|
|
45 |
end
|