135 in ((RepC, AbsC, axiom_name, axiom), axiom_lthy) end; |
135 in ((RepC, AbsC, axiom_name, axiom), axiom_lthy) end; |
136 |
136 |
137 |
137 |
138 (* prepare_typedef *) |
138 (* prepare_typedef *) |
139 |
139 |
140 fun prepare_typedef conceal prep_term (name, raw_args, mx) raw_set opt_morphs lthy = |
140 fun prepare_typedef concealed prep_term (name, raw_args, mx) raw_set opt_morphs lthy = |
141 let |
141 let |
142 val concealed_name = name |> conceal ? Binding.conceal; |
142 val concealed_name = name |> concealed ? Binding.concealed; |
143 val bname = Binding.name_of name; |
143 val bname = Binding.name_of name; |
144 |
144 |
145 |
145 |
146 (* rhs *) |
146 (* rhs *) |
147 |
147 |
240 cat_error msg ("The error(s) above occurred in typedef " ^ Binding.print name); |
240 cat_error msg ("The error(s) above occurred in typedef " ^ Binding.print name); |
241 |
241 |
242 |
242 |
243 (* add_typedef: tactic interface *) |
243 (* add_typedef: tactic interface *) |
244 |
244 |
245 fun add_typedef conceal typ set opt_morphs tac lthy = |
245 fun add_typedef concealed typ set opt_morphs tac lthy = |
246 let |
246 let |
247 val ((goal, _, typedef_result), lthy') = |
247 val ((goal, _, typedef_result), lthy') = |
248 prepare_typedef conceal Syntax.check_term typ set opt_morphs lthy; |
248 prepare_typedef concealed Syntax.check_term typ set opt_morphs lthy; |
249 val inhabited = |
249 val inhabited = |
250 Goal.prove lthy' [] [] goal (tac o #context) |
250 Goal.prove lthy' [] [] goal (tac o #context) |
251 |> Goal.norm_result lthy' |> Thm.close_derivation; |
251 |> Goal.norm_result lthy' |> Thm.close_derivation; |
252 in typedef_result inhabited lthy' end; |
252 in typedef_result inhabited lthy' end; |
253 |
253 |
254 fun add_typedef_global conceal typ set opt_morphs tac = |
254 fun add_typedef_global concealed typ set opt_morphs tac = |
255 Named_Target.theory_init |
255 Named_Target.theory_init |
256 #> add_typedef conceal typ set opt_morphs tac |
256 #> add_typedef concealed typ set opt_morphs tac |
257 #> Local_Theory.exit_result_global (apsnd o transform_info); |
257 #> Local_Theory.exit_result_global (apsnd o transform_info); |
258 |
258 |
259 |
259 |
260 (* typedef: proof interface *) |
260 (* typedef: proof interface *) |
261 |
261 |