src/Tools/coherent.ML
changeset 67149 e61557884799
parent 61268 abe08fb15a12
child 67522 9e712280cc37
equal deleted inserted replaced
67148:d24dcac5eb4c 67149:e61557884799
    27 functor Coherent(Data: COHERENT_DATA) : COHERENT =
    27 functor Coherent(Data: COHERENT_DATA) : COHERENT =
    28 struct
    28 struct
    29 
    29 
    30 (** misc tools **)
    30 (** misc tools **)
    31 
    31 
    32 val (trace, trace_setup) = Attrib.config_bool @{binding coherent_trace} (K false);
    32 val (trace, trace_setup) = Attrib.config_bool \<^binding>\<open>coherent_trace\<close> (K false);
    33 fun cond_trace ctxt msg = if Config.get ctxt trace then tracing (msg ()) else ();
    33 fun cond_trace ctxt msg = if Config.get ctxt trace then tracing (msg ()) else ();
    34 
    34 
    35 datatype cl_prf =
    35 datatype cl_prf =
    36   ClPrf of thm * (Type.tyenv * Envir.tenv) * ((indexname * typ) * term) list *
    36   ClPrf of thm * (Type.tyenv * Envir.tenv) * ((indexname * typ) * term) list *
    37   int list * (term list * cl_prf) list;
    37   int list * (term list * cl_prf) list;
   225       | SOME prf => resolve_tac ctxt'' [thm_of_cl_prf ctxt'' concl [] prf] 1)
   225       | SOME prf => resolve_tac ctxt'' [thm_of_cl_prf ctxt'' concl [] prf] 1)
   226     end) ctxt' 1) ctxt;
   226     end) ctxt' 1) ctxt;
   227 
   227 
   228 val _ = Theory.setup
   228 val _ = Theory.setup
   229   (trace_setup #>
   229   (trace_setup #>
   230    Method.setup @{binding coherent}
   230    Method.setup \<^binding>\<open>coherent\<close>
   231     (Attrib.thms >> (fn rules => fn ctxt =>
   231     (Attrib.thms >> (fn rules => fn ctxt =>
   232         METHOD (fn facts => HEADGOAL (coherent_tac ctxt (facts @ rules)))))
   232         METHOD (fn facts => HEADGOAL (coherent_tac ctxt (facts @ rules)))))
   233       "prove coherent formula");
   233       "prove coherent formula");
   234 
   234 
   235 end;
   235 end;