src/Pure/thm.ML
changeset 6368 ba5e97a20b12
parent 6089 4d2d5556b4f9
child 6390 5d58c100ca3f
equal deleted inserted replaced
6367:7f36b6fd3eb3 6368:ba5e97a20b12
   102   val extra_shyps       : thm -> sort list
   102   val extra_shyps       : thm -> sort list
   103   val force_strip_shyps : bool ref      (* FIXME tmp (since 1995/08/01) *)
   103   val force_strip_shyps : bool ref      (* FIXME tmp (since 1995/08/01) *)
   104   val strip_shyps       : thm -> thm
   104   val strip_shyps       : thm -> thm
   105   val implies_intr_shyps: thm -> thm
   105   val implies_intr_shyps: thm -> thm
   106   val get_axiom         : theory -> xstring -> thm
   106   val get_axiom         : theory -> xstring -> thm
       
   107   val def_name		: string -> string
   107   val get_def           : theory -> xstring -> thm
   108   val get_def           : theory -> xstring -> thm
   108   val axioms_of         : theory -> (string * thm) list
   109   val axioms_of         : theory -> (string * thm) list
   109 
   110 
   110   (*meta rules*)
   111   (*meta rules*)
   111   val assume            : cterm -> thm
   112   val assume            : cterm -> thm
   126   val implies_intr_hyps : thm -> thm
   127   val implies_intr_hyps : thm -> thm
   127   val flexflex_rule     : thm -> thm Seq.seq
   128   val flexflex_rule     : thm -> thm Seq.seq
   128   val instantiate       :
   129   val instantiate       :
   129     (indexname * ctyp) list * (cterm * cterm) list -> thm -> thm
   130     (indexname * ctyp) list * (cterm * cterm) list -> thm -> thm
   130   val trivial           : cterm -> thm
   131   val trivial           : cterm -> thm
   131   val class_triv        : theory -> class -> thm
   132   val class_triv        : Sign.sg -> class -> thm
   132   val varifyT           : thm -> thm
   133   val varifyT           : thm -> thm
   133   val freezeT           : thm -> thm
   134   val freezeT           : thm -> thm
   134   val dest_state        : thm * int ->
   135   val dest_state        : thm * int ->
   135     (term * term) list * term list * term * term
   136     (term * term) list * term list * term * term
   136   val lift_rule         : (thm * int) -> thm -> thm
   137   val lift_rule         : (thm * int) -> thm -> thm
   617     (case get_ax (theory :: Theory.ancestors_of theory) of
   618     (case get_ax (theory :: Theory.ancestors_of theory) of
   618       Some thm => thm
   619       Some thm => thm
   619     | None => raise THEORY ("No axiom " ^ quote name, [theory]))
   620     | None => raise THEORY ("No axiom " ^ quote name, [theory]))
   620   end;
   621   end;
   621 
   622 
   622 fun get_def thy name = get_axiom thy (name ^ "_def");
   623 fun def_name name = name ^ "_def";
       
   624 fun get_def thy = get_axiom thy o def_name;
   623 
   625 
   624 
   626 
   625 (*return additional axioms of this theory node*)
   627 (*return additional axioms of this theory node*)
   626 fun axioms_of thy =
   628 fun axioms_of thy =
   627   map (fn (s, _) => (s, get_axiom thy s))
   629   map (fn (s, _) => (s, get_axiom thy s))
  1121              hyps = [],
  1123              hyps = [],
  1122              prop = implies$A$A})
  1124              prop = implies$A$A})
  1123   end;
  1125   end;
  1124 
  1126 
  1125 (*Axiom-scheme reflecting signature contents: "OFCLASS(?'a::c, c_class)" *)
  1127 (*Axiom-scheme reflecting signature contents: "OFCLASS(?'a::c, c_class)" *)
  1126 fun class_triv thy c =
  1128 fun class_triv sign c =
  1127   let val sign = sign_of thy;
  1129   let val Cterm {sign_ref, t, maxidx, ...} =
  1128       val Cterm {sign_ref, t, maxidx, ...} =
  1130     cterm_of sign (Logic.mk_inclass (TVar (("'a", 0), [c]), c))
  1129           cterm_of sign (Logic.mk_inclass (TVar (("'a", 0), [c]), c))
  1131       handle TERM (msg, _) => raise THM ("class_triv: " ^ msg, 0, []);
  1130             handle TERM (msg, _) => raise THM ("class_triv: " ^ msg, 0, []);
       
  1131   in
  1132   in
  1132     fix_shyps [] []
  1133     fix_shyps [] []
  1133       (Thm {sign_ref = sign_ref, 
  1134       (Thm {sign_ref = sign_ref, 
  1134             der = infer_derivs (Class_triv c, []), 
  1135             der = infer_derivs (Class_triv c, []), 
  1135             maxidx = maxidx, 
  1136             maxidx = maxidx,