15 |
22 |
16 ML{* |
23 ML{* |
17 Quotient_Info.quotient_rules_get @{context} |
24 Quotient_Info.quotient_rules_get @{context} |
18 *} |
25 *} |
19 |
26 |
20 fun |
27 quotient_type int = "nat \<times> nat" / "\<lambda>(x, y) (u, v). x + v = u + (y::nat)" |
21 intrel :: "(nat \<times> nat) \<Rightarrow> (nat \<times> nat) \<Rightarrow> bool" |
28 apply(rule equivpI) |
22 where |
29 unfolding reflp_def symp_def transp_def |
23 "intrel (x, y) (u, v) = (x + v = u + y)" |
30 apply(auto) |
24 |
31 done |
25 quotient_type int = "nat \<times> nat" / intrel |
|
26 sorry |
|
27 |
32 |
28 print_quotients |
33 print_quotients |
29 |
34 |
30 ML {* |
35 ML {* |
31 open Quotient_Term; |
36 open Quotient_Term; |
32 *} |
37 *} |
33 |
38 |
34 ML {* |
39 ML {* |
35 absrep_fun_chk absF @{context} (@{typ "(((nat * nat) list) * 'a) option"}, @{typ "((int fset) * 'a) option"}) |
40 absrep_fun_chk absF @{context} |
|
41 (@{typ "(('a * 'a) list) list"}, |
|
42 @{typ "(('a * 'a) fset) fset"}) |
36 |> Syntax.string_of_term @{context} |
43 |> Syntax.string_of_term @{context} |
37 |> writeln |
44 |> writeln |
38 *} |
45 *} |
|
46 |
|
47 (* |
|
48 ML {* |
|
49 absrep_fun_chk absF @{context} |
|
50 (@{typ "('a * 'a) list"}, |
|
51 @{typ "'a foo"}) |
|
52 |> Syntax.string_of_term @{context} |
|
53 |> writeln |
|
54 *} |
|
55 *) |
39 |
56 |
40 term "option_map (prod_fun (abs_fset \<circ> map abs_int) id)" |
57 term "option_map (prod_fun (abs_fset \<circ> map abs_int) id)" |
41 term "option_map (prod_fun (map rep_int \<circ> rep_fset) id)" |
58 term "option_map (prod_fun (map rep_int \<circ> rep_fset) id)" |
42 term "option_map (map rep_int \<circ> rep_fset)" |
59 term "option_map (map rep_int \<circ> rep_fset)" |
43 term "option_map (abs_fset o (map abs_int))" |
60 term "option_map (abs_fset o (map abs_int))" |