src/HOL/Tools/Nitpick/nitpick_preproc.ML
changeset 36555 8ff45c2076da
parent 36389 8228b3a4a2ba
child 37253 e01c1fe245cd
equal deleted inserted replaced
36554:2673979cb54d 36555:8ff45c2076da
   912              else if Refute.is_const_of_class thy x then
   912              else if Refute.is_const_of_class thy x then
   913                let
   913                let
   914                  val class = Logic.class_of_const s
   914                  val class = Logic.class_of_const s
   915                  val of_class = Logic.mk_of_class (TVar (("'a", 0), [class]),
   915                  val of_class = Logic.mk_of_class (TVar (("'a", 0), [class]),
   916                                                    class)
   916                                                    class)
   917                  val ax1 = try (Refute.specialize_type thy x) of_class
   917                  val ax1 = try (specialize_type thy x) of_class
   918                  val ax2 = Option.map (Refute.specialize_type thy x o snd)
   918                  val ax2 = Option.map (specialize_type thy x o snd)
   919                                       (Refute.get_classdef thy class)
   919                                       (Refute.get_classdef thy class)
   920                in
   920                in
   921                  fold (add_maybe_def_axiom depth) (map_filter I [ax1, ax2])
   921                  fold (add_maybe_def_axiom depth) (map_filter I [ax1, ax2])
   922                       accum
   922                       accum
   923                end
   923                end
   995                                          handle ERROR _ => [])) supers
   995                                          handle ERROR _ => [])) supers
   996         val monomorphic_class_axioms =
   996         val monomorphic_class_axioms =
   997           map (fn t => case Term.add_tvars t [] of
   997           map (fn t => case Term.add_tvars t [] of
   998                          [] => t
   998                          [] => t
   999                        | [(x, S)] =>
   999                        | [(x, S)] =>
  1000                          Refute.monomorphic_term (Vartab.make [(x, (S, T))]) t
  1000                          monomorphic_term (Vartab.make [(x, (S, T))]) t
  1001                        | _ => raise TERM ("Nitpick_Preproc.axioms_for_term.\
  1001                        | _ => raise TERM ("Nitpick_Preproc.axioms_for_term.\
  1002                                           \add_axioms_for_sort", [t]))
  1002                                           \add_axioms_for_sort", [t]))
  1003               class_axioms
  1003               class_axioms
  1004       in fold (add_nondef_axiom depth) monomorphic_class_axioms end
  1004       in fold (add_nondef_axiom depth) monomorphic_class_axioms end
  1005     val (mono_user_nondefs, poly_user_nondefs) =
  1005     val (mono_user_nondefs, poly_user_nondefs) =