src/HOL/Tools/Predicate_Compile/predicate_compile_data.ML
changeset 36610 bafd82950e24
parent 35758 c029f85d3879
child 37007 116670499530
equal deleted inserted replaced
36609:6ed6112f0a95 36610:bafd82950e24
   127     val res = Name.names ctxt s xs
   127     val res = Name.names ctxt s xs
   128   in (res, fold Name.declare (map fst res) ctxt) end
   128   in (res, fold Name.declare (map fst res) ctxt) end
   129   
   129   
   130 fun split_all_pairs thy th =
   130 fun split_all_pairs thy th =
   131   let
   131   let
   132     val ctxt = ProofContext.init thy
   132     val ctxt = ProofContext.init_global thy
   133     val ((_, [th']), ctxt') = Variable.import true [th] ctxt
   133     val ((_, [th']), ctxt') = Variable.import true [th] ctxt
   134     val t = prop_of th'
   134     val t = prop_of th'
   135     val frees = Term.add_frees t [] 
   135     val frees = Term.add_frees t [] 
   136     val freenames = Term.add_free_names t []
   136     val freenames = Term.add_free_names t []
   137     val nctxt = Name.make_context freenames
   137     val nctxt = Name.make_context freenames
   151   end;
   151   end;
   152 
   152 
   153 
   153 
   154 fun inline_equations thy th =
   154 fun inline_equations thy th =
   155   let
   155   let
   156     val inline_defs = Predicate_Compile_Inline_Defs.get (ProofContext.init thy)
   156     val inline_defs = Predicate_Compile_Inline_Defs.get (ProofContext.init_global thy)
   157     val th' = (Simplifier.full_simplify (HOL_basic_ss addsimps inline_defs)) th
   157     val th' = (Simplifier.full_simplify (HOL_basic_ss addsimps inline_defs)) th
   158     (*val _ = print_step options 
   158     (*val _ = print_step options 
   159       ("Inlining " ^ (Syntax.string_of_term_global thy (prop_of th))
   159       ("Inlining " ^ (Syntax.string_of_term_global thy (prop_of th))
   160        ^ "with " ^ (commas (map ((Syntax.string_of_term_global thy) o prop_of) inline_defs))
   160        ^ "with " ^ (commas (map ((Syntax.string_of_term_global thy) o prop_of) inline_defs))
   161        ^" to " ^ (Syntax.string_of_term_global thy (prop_of th')))*)
   161        ^" to " ^ (Syntax.string_of_term_global thy (prop_of th')))*)
   186     val t = Const (AxClass.unoverload_const thy (c, T), T)*)
   186     val t = Const (AxClass.unoverload_const thy (c, T), T)*)
   187     val _ = if show_steps options then
   187     val _ = if show_steps options then
   188         tracing ("getting specification of " ^ Syntax.string_of_term_global thy t ^
   188         tracing ("getting specification of " ^ Syntax.string_of_term_global thy t ^
   189           " with type " ^ Syntax.string_of_typ_global thy (fastype_of t))
   189           " with type " ^ Syntax.string_of_typ_global thy (fastype_of t))
   190       else ()
   190       else ()
   191     val ctxt = ProofContext.init thy
   191     val ctxt = ProofContext.init_global thy
   192     fun filtering th =
   192     fun filtering th =
   193       if is_equationlike th andalso
   193       if is_equationlike th andalso
   194         defining_const_of_equation (normalize_equation thy th) = fst (dest_Const t) then
   194         defining_const_of_equation (normalize_equation thy th) = fst (dest_Const t) then
   195         SOME (normalize_equation thy th)
   195         SOME (normalize_equation thy th)
   196       else
   196       else