detect OFCLASS() axioms in Nitpick;
authorblanchet
Mon, 22 Mar 2010 15:07:07 +0100
changeset 35893 02595d4a3a7c
parent 35892 5ed2e9a545ac
child 35894 ab6dc4d86ea1
child 35962 0e2d57686b3c
detect OFCLASS() axioms in Nitpick; this is necessary now that "Thy.all_axioms_of" returns such axiom (starting with change 46cfc4b8112e)
src/HOL/Tools/Nitpick/nitpick_hol.ML
--- a/src/HOL/Tools/Nitpick/nitpick_hol.ML	Mon Mar 22 13:48:15 2010 +0100
+++ b/src/HOL/Tools/Nitpick/nitpick_hol.ML	Mon Mar 22 15:07:07 2010 +0100
@@ -1263,6 +1263,10 @@
          $ Const _ $ _)) =
     boring <> is_funky_typedef_name thy s andalso is_typedef thy s
   | is_typedef_axiom _ _ _ = false
+(* term -> bool *)
+fun is_class_axiom t =
+  (t |> Logic.strip_horn |> swap |> op :: |> map Logic.dest_of_class; true)
+  handle TERM _ => false
 
 (* Distinguishes between (1) constant definition axioms, (2) type arity and
    typedef axioms, and (3) other axioms, and returns the pair ((1), (3)).
@@ -1306,7 +1310,9 @@
   let
     (* theory list -> term list *)
     val axioms_of_thys =
-      maps Thm.axioms_of #> map (apsnd (subst_atomic subst o prop_of))
+      maps Thm.axioms_of
+      #> map (apsnd (subst_atomic subst o prop_of))
+      #> filter_out (is_class_axiom o snd)
     val specs = Defs.all_specifications_of (Theory.defs_of thy)
     val def_names = specs |> maps snd |> map_filter #def
                     |> OrdList.make fast_string_ord