equal
deleted
inserted
replaced
42 fun ants MRSL thm = fold (fn rl => fn thm => rl RS thm) ants thm |
42 fun ants MRSL thm = fold (fn rl => fn thm => rl RS thm) ants thm |
43 |
43 |
44 fun option_fold a _ NONE = a |
44 fun option_fold a _ NONE = a |
45 | option_fold _ f (SOME x) = f x |
45 | option_fold _ f (SOME x) = f x |
46 |
46 |
47 fun dest_Quotient (Const (@{const_name Quotient}, _) $ rel $ abs $ rep $ cr) |
47 fun dest_Quotient (Const (\<^const_name>\<open>Quotient\<close>, _) $ rel $ abs $ rep $ cr) |
48 = (rel, abs, rep, cr) |
48 = (rel, abs, rep, cr) |
49 | dest_Quotient t = raise TERM ("dest_Quotient", [t]) |
49 | dest_Quotient t = raise TERM ("dest_Quotient", [t]) |
50 |
50 |
51 (* |
51 (* |
52 quot_thm_rel, quot_thm_abs, quot_thm_rep and quot_thm_rty_qty - simple functions |
52 quot_thm_rel, quot_thm_abs, quot_thm_rep and quot_thm_rty_qty - simple functions |
89 Thm.implies_elim thm (Thm.assume assm) |
89 Thm.implies_elim thm (Thm.assume assm) |
90 end |
90 end |
91 |
91 |
92 fun undisch_all thm = funpow (Thm.nprems_of thm) undisch thm |
92 fun undisch_all thm = funpow (Thm.nprems_of thm) undisch thm |
93 |
93 |
94 fun is_fun_type (Type (@{type_name fun}, _)) = true |
94 fun is_fun_type (Type (\<^type_name>\<open>fun\<close>, _)) = true |
95 | is_fun_type _ = false |
95 | is_fun_type _ = false |
96 |
96 |
97 fun get_args n = rev o fst o funpow_yield n (swap o dest_comb) |
97 fun get_args n = rev o fst o funpow_yield n (swap o dest_comb) |
98 |
98 |
99 fun strip_args n = funpow n (fst o dest_comb) |
99 fun strip_args n = funpow n (fst o dest_comb) |
107 | Targs _ = [] |
107 | Targs _ = [] |
108 |
108 |
109 fun Tname (Type (name, _)) = name |
109 fun Tname (Type (name, _)) = name |
110 | Tname _ = "" |
110 | Tname _ = "" |
111 |
111 |
112 fun is_rel_fun (Const (@{const_name "rel_fun"}, _) $ _ $ _) = true |
112 fun is_rel_fun (Const (\<^const_name>\<open>rel_fun\<close>, _) $ _ $ _) = true |
113 | is_rel_fun _ = false |
113 | is_rel_fun _ = false |
114 |
114 |
115 fun relation_types typ = |
115 fun relation_types typ = |
116 case strip_type typ of |
116 case strip_type typ of |
117 ([typ1, typ2], @{typ bool}) => (typ1, typ2) |
117 ([typ1, typ2], \<^typ>\<open>bool\<close>) => (typ1, typ2) |
118 | _ => error "relation_types: not a relation" |
118 | _ => error "relation_types: not a relation" |
119 |
119 |
120 fun map_interrupt f l = |
120 fun map_interrupt f l = |
121 let |
121 let |
122 fun map_interrupt' _ [] l = SOME (rev l) |
122 fun map_interrupt' _ [] l = SOME (rev l) |