equal
deleted
inserted
replaced
217 end |
217 end |
218 |
218 |
219 (* check for existence of map functions *) |
219 (* check for existence of map functions *) |
220 fun map_check ctxt (_, (rty, _, _)) = |
220 fun map_check ctxt (_, (rty, _, _)) = |
221 let |
221 let |
222 val thy = Proof_Context.theory_of ctxt |
|
223 |
|
224 fun map_check_aux rty warns = |
222 fun map_check_aux rty warns = |
225 case rty of |
223 (case rty of |
226 Type (_, []) => warns |
224 Type (_, []) => warns |
227 | Type (s, _) => if is_some (Quotient_Info.lookup_quotmaps thy s) then warns else s :: warns |
225 | Type (s, _) => if is_some (Quotient_Info.lookup_quotmaps ctxt s) then warns else s :: warns |
228 | _ => warns |
226 | _ => warns) |
229 |
227 |
230 val warns = map_check_aux rty [] |
228 val warns = map_check_aux rty [] |
231 in |
229 in |
232 if null warns then () |
230 if null warns then () |
233 else warning ("No map function defined for " ^ commas warns ^ |
231 else warning ("No map function defined for " ^ commas warns ^ |
308 val _ = |
306 val _ = |
309 Outer_Syntax.local_theory_to_proof "quotient_type" |
307 Outer_Syntax.local_theory_to_proof "quotient_type" |
310 "quotient type definitions (require equivalence proofs)" |
308 "quotient type definitions (require equivalence proofs)" |
311 Keyword.thy_goal (quotspec_parser >> quotient_type_cmd) |
309 Keyword.thy_goal (quotspec_parser >> quotient_type_cmd) |
312 |
310 |
313 end; (* structure *) |
311 end; |