src/HOL/Tools/Sledgehammer/sledgehammer_filter.ML
changeset 46438 93344b60cb30
parent 46393 69f2d19f7d33
child 46734 6256e064f8fa
equal deleted inserted replaced
46437:9552b6f2c670 46438:93344b60cb30
   113 
   113 
   114 val crude_zero_vars =
   114 val crude_zero_vars =
   115   map_aterms (fn Var ((s, _), T) => Var ((s, 0), T) | t => t)
   115   map_aterms (fn Var ((s, _), T) => Var ((s, 0), T) | t => t)
   116   #> map_types (map_type_tvar (fn ((s, _), S) => TVar ((s, 0), S)))
   116   #> map_types (map_type_tvar (fn ((s, _), S) => TVar ((s, 0), S)))
   117 
   117 
       
   118 (* unfolding these can yield really huge terms *)
       
   119 val risky_spec_eqs = @{thms Bit0_def Bit1_def}
       
   120 
   118 fun clasimpset_rule_table_of ctxt =
   121 fun clasimpset_rule_table_of ctxt =
   119   let
   122   let
   120     val thy = Proof_Context.theory_of ctxt
   123     val thy = Proof_Context.theory_of ctxt
   121     val atomize = HOLogic.mk_Trueprop o Object_Logic.atomize_term thy
   124     val atomize = HOLogic.mk_Trueprop o Object_Logic.atomize_term thy
   122     fun add stature g f =
   125     fun add stature g f =
   130     val simps = ctxt |> simpset_of |> dest_ss |> #simps
   133     val simps = ctxt |> simpset_of |> dest_ss |> #simps
   131     val spec_eqs =
   134     val spec_eqs =
   132       ctxt |> Spec_Rules.get
   135       ctxt |> Spec_Rules.get
   133            |> filter (curry (op =) Spec_Rules.Equational o fst)
   136            |> filter (curry (op =) Spec_Rules.Equational o fst)
   134            |> maps (snd o snd)
   137            |> maps (snd o snd)
       
   138            |> filter_out (member Thm.eq_thm_prop risky_spec_eqs)
   135   in
   139   in
   136     Termtab.empty |> add Simp I snd simps
   140     Termtab.empty |> add Simp I snd simps
   137                   |> add Simp atomize snd simps
   141                   |> add Simp atomize snd simps
   138                   |> add Spec_Eq I I spec_eqs
   142                   |> add Spec_Eq I I spec_eqs
   139                   |> add Elim I I elims
   143                   |> add Elim I I elims