src/Pure/thm.ML
changeset 4018 09b77900af0f
parent 3994 0343230ec85c
child 4036 bd686e39bff8
equal deleted inserted replaced
4017:63878e2587a7 4018:09b77900af0f
    98   val force_strip_shyps : bool ref      (* FIXME tmp (since 1995/08/01) *)
    98   val force_strip_shyps : bool ref      (* FIXME tmp (since 1995/08/01) *)
    99   val strip_shyps       : thm -> thm
    99   val strip_shyps       : thm -> thm
   100   val implies_intr_shyps: thm -> thm
   100   val implies_intr_shyps: thm -> thm
   101   val get_axiom         : theory -> xstring -> thm
   101   val get_axiom         : theory -> xstring -> thm
   102   val name_thm          : string * thm -> thm
   102   val name_thm          : string * thm -> thm
       
   103   val name_of_thm	: thm -> string
   103   val axioms_of         : theory -> (string * thm) list
   104   val axioms_of         : theory -> (string * thm) list
   104 
   105 
   105   (*meta rules*)
   106   (*meta rules*)
   106   val assume            : cterm -> thm
   107   val assume            : cterm -> thm
   107   val compress          : thm -> thm
   108   val compress          : thm -> thm
   601 fun axioms_of thy =
   602 fun axioms_of thy =
   602   map (fn (s, _) => (s, get_axiom thy s))
   603   map (fn (s, _) => (s, get_axiom thy s))
   603     (Symtab.dest (#axioms (rep_theory thy)));
   604     (Symtab.dest (#axioms (rep_theory thy)));
   604 
   605 
   605 (*Attach a label to a theorem to make proof objects more readable*)
   606 (*Attach a label to a theorem to make proof objects more readable*)
   606 fun name_thm (name, th as Thm {sign_ref, der, maxidx, shyps, hyps, prop}) = 
   607 fun name_thm (name, th as Thm {sign_ref, der, maxidx, shyps, hyps, prop}) =
   607     Thm {sign_ref = sign_ref, 
   608   (case der of
   608          der = Join (Theorem name, [der]),
   609     Join (Theorem _, _) => th
   609          maxidx = maxidx,
   610   | Join (Axiom _, _) => th
   610          shyps = shyps, 
   611   | _ => Thm {sign_ref = sign_ref, der = Join (Theorem name, [der]),
   611          hyps = hyps, 
   612       maxidx = maxidx, shyps = shyps, hyps = hyps, prop = prop});
   612          prop = prop};
   613 
       
   614 fun name_of_thm (Thm {der, ...}) =
       
   615   (case der of
       
   616     Join (Theorem name, _) => name
       
   617   | Join (Axiom (_, name), _) => name
       
   618   | _ => "");
   613 
   619 
   614 
   620 
   615 (*Compression of theorems -- a separate rule, not integrated with the others,
   621 (*Compression of theorems -- a separate rule, not integrated with the others,
   616   as it could be slow.*)
   622   as it could be slow.*)
   617 fun compress (Thm {sign_ref, der, maxidx, shyps, hyps, prop}) = 
   623 fun compress (Thm {sign_ref, der, maxidx, shyps, hyps, prop}) =