src/Pure/more_thm.ML
author wenzelm
Thu Oct 23 15:28:01 2008 +0200 (2008-10-23)
changeset 28674 08a77c495dc1
parent 28621 a60164e8fff0
child 28965 1de908189869
permissions -rw-r--r--
renamed Thm.get_axiom_i to Thm.axiom;
wenzelm@22362
     1
(*  Title:      Pure/more_thm.ML
wenzelm@22362
     2
    ID:         $Id$
wenzelm@22362
     3
    Author:     Makarius
wenzelm@22362
     4
wenzelm@22907
     5
Further operations on type ctyp/cterm/thm, outside the inference kernel.
wenzelm@22362
     6
*)
wenzelm@22362
     7
wenzelm@23169
     8
infix aconvc;
wenzelm@23169
     9
wenzelm@22362
    10
signature THM =
wenzelm@22362
    11
sig
wenzelm@22362
    12
  include THM
wenzelm@24948
    13
  val aconvc: cterm * cterm -> bool
wenzelm@23491
    14
  val add_cterm_frees: cterm -> cterm list -> cterm list
wenzelm@22907
    15
  val mk_binop: cterm -> cterm -> cterm -> cterm
wenzelm@22907
    16
  val dest_binop: cterm -> cterm * cterm
wenzelm@22907
    17
  val dest_implies: cterm -> cterm * cterm
wenzelm@22907
    18
  val dest_equals: cterm -> cterm * cterm
wenzelm@22907
    19
  val dest_equals_lhs: cterm -> cterm
wenzelm@22907
    20
  val dest_equals_rhs: cterm -> cterm
wenzelm@22907
    21
  val lhs_of: thm -> cterm
wenzelm@22907
    22
  val rhs_of: thm -> cterm
wenzelm@22362
    23
  val thm_ord: thm * thm -> order
wenzelm@23599
    24
  val is_reflexive: thm -> bool
wenzelm@22362
    25
  val eq_thm: thm * thm -> bool
wenzelm@22362
    26
  val eq_thms: thm list * thm list -> bool
wenzelm@22362
    27
  val eq_thm_thy: thm * thm -> bool
wenzelm@22362
    28
  val eq_thm_prop: thm * thm -> bool
wenzelm@22362
    29
  val equiv_thm: thm * thm -> bool
wenzelm@28621
    30
  val check_shyps: sort list -> thm -> thm
wenzelm@24048
    31
  val is_dummy: thm -> bool
wenzelm@22695
    32
  val plain_prop_of: thm -> term
wenzelm@22695
    33
  val fold_terms: (term -> 'a -> 'a) -> thm -> 'a -> 'a
wenzelm@24048
    34
  val add_thm: thm -> thm list -> thm list
wenzelm@24048
    35
  val del_thm: thm -> thm list -> thm list
wenzelm@24048
    36
  val merge_thms: thm list * thm list -> thm list
wenzelm@27866
    37
  val elim_implies: thm -> thm -> thm
wenzelm@27866
    38
  val forall_elim_var: int -> thm -> thm
wenzelm@27866
    39
  val forall_elim_vars: int -> thm -> thm
wenzelm@27866
    40
  val unvarify: thm -> thm
wenzelm@27866
    41
  val close_derivation: thm -> thm
wenzelm@28116
    42
  val add_axiom: bstring * term -> theory -> thm * theory
wenzelm@27866
    43
  val add_def: bool -> bool -> bstring * term -> theory -> thm * theory
wenzelm@27866
    44
  val rule_attribute: (Context.generic -> thm -> thm) -> attribute
wenzelm@27866
    45
  val declaration_attribute: (thm -> Context.generic -> Context.generic) -> attribute
wenzelm@27866
    46
  val theory_attributes: attribute list -> theory * thm -> theory * thm
wenzelm@27866
    47
  val proof_attributes: attribute list -> Proof.context * thm -> Proof.context * thm
wenzelm@27866
    48
  val no_attributes: 'a -> 'a * 'b list
wenzelm@27866
    49
  val simple_fact: 'a -> ('a * 'b list) list
wenzelm@28017
    50
  val tag_rule: Properties.property -> thm -> thm
wenzelm@27866
    51
  val untag_rule: string -> thm -> thm
wenzelm@28017
    52
  val tag: Properties.property -> attribute
wenzelm@27866
    53
  val untag: string -> attribute
wenzelm@27866
    54
  val position_of: thm -> Position.T
wenzelm@27866
    55
  val default_position: Position.T -> thm -> thm
wenzelm@27866
    56
  val default_position_of: thm -> thm -> thm
wenzelm@27866
    57
  val has_name_hint: thm -> bool
wenzelm@27866
    58
  val get_name_hint: thm -> string
wenzelm@27866
    59
  val put_name_hint: string -> thm -> thm
wenzelm@27866
    60
  val get_group: thm -> string option
wenzelm@27866
    61
  val put_group: string -> thm -> thm
wenzelm@27866
    62
  val group: string -> attribute
wenzelm@22362
    63
  val axiomK: string
wenzelm@22362
    64
  val assumptionK: string
wenzelm@22362
    65
  val definitionK: string
wenzelm@22362
    66
  val theoremK: string
wenzelm@22362
    67
  val lemmaK: string
wenzelm@22362
    68
  val corollaryK: string
wenzelm@22362
    69
  val internalK: string
wenzelm@27866
    70
  val has_kind: thm -> bool
wenzelm@27866
    71
  val get_kind: thm -> string
wenzelm@27866
    72
  val kind_rule: string -> thm -> thm
wenzelm@27866
    73
  val kind: string -> attribute
wenzelm@27866
    74
  val kind_internal: attribute
wenzelm@28017
    75
  val has_internal: Properties.property list -> bool
wenzelm@27866
    76
  val is_internal: thm -> bool
wenzelm@22362
    77
end;
wenzelm@22362
    78
wenzelm@22362
    79
structure Thm: THM =
wenzelm@22362
    80
struct
wenzelm@22362
    81
wenzelm@22695
    82
(** basic operations **)
wenzelm@22362
    83
wenzelm@23491
    84
(* collecting cterms *)
wenzelm@23491
    85
wenzelm@23491
    86
val op aconvc = op aconv o pairself Thm.term_of;
wenzelm@23491
    87
wenzelm@23491
    88
fun add_cterm_frees ct =
wenzelm@23491
    89
  let
wenzelm@23491
    90
    val cert = Thm.cterm_of (Thm.theory_of_cterm ct);
wenzelm@23491
    91
    val t = Thm.term_of ct;
wenzelm@23491
    92
  in Term.fold_aterms (fn v as Free _ => insert (op aconvc) (cert v) | _ => I) t end;
wenzelm@23491
    93
wenzelm@23491
    94
wenzelm@22907
    95
(* cterm constructors and destructors *)
wenzelm@22907
    96
wenzelm@22907
    97
fun mk_binop c a b = Thm.capply (Thm.capply c a) b;
wenzelm@22907
    98
fun dest_binop ct = (Thm.dest_arg1 ct, Thm.dest_arg ct);
wenzelm@22907
    99
wenzelm@22907
   100
fun dest_implies ct =
wenzelm@22907
   101
  (case Thm.term_of ct of
wenzelm@22907
   102
    Const ("==>", _) $ _ $ _ => dest_binop ct
wenzelm@22907
   103
  | _ => raise TERM ("dest_implies", [Thm.term_of ct]));
wenzelm@22907
   104
wenzelm@22907
   105
fun dest_equals ct =
wenzelm@22907
   106
  (case Thm.term_of ct of
wenzelm@22907
   107
    Const ("==", _) $ _ $ _ => dest_binop ct
wenzelm@22907
   108
  | _ => raise TERM ("dest_equals", [Thm.term_of ct]));
wenzelm@22907
   109
wenzelm@22907
   110
fun dest_equals_lhs ct =
wenzelm@22907
   111
  (case Thm.term_of ct of
wenzelm@22907
   112
    Const ("==", _) $ _ $ _ => Thm.dest_arg1 ct
wenzelm@22907
   113
  | _ => raise TERM ("dest_equals_lhs", [Thm.term_of ct]));
wenzelm@22907
   114
wenzelm@22907
   115
fun dest_equals_rhs ct =
wenzelm@22907
   116
  (case Thm.term_of ct of
wenzelm@22907
   117
    Const ("==", _) $ _ $ _ => Thm.dest_arg ct
wenzelm@22907
   118
  | _ => raise TERM ("dest_equals_rhs", [Thm.term_of ct]));
wenzelm@22907
   119
wenzelm@22907
   120
val lhs_of = dest_equals_lhs o Thm.cprop_of;
wenzelm@22907
   121
val rhs_of = dest_equals_rhs o Thm.cprop_of;
wenzelm@22907
   122
wenzelm@22907
   123
wenzelm@22907
   124
(* thm order: ignores theory context! *)
wenzelm@22682
   125
wenzelm@22362
   126
fun thm_ord (th1, th2) =
wenzelm@22362
   127
  let
wenzelm@22362
   128
    val {shyps = shyps1, hyps = hyps1, tpairs = tpairs1, prop = prop1, ...} = Thm.rep_thm th1;
wenzelm@22362
   129
    val {shyps = shyps2, hyps = hyps2, tpairs = tpairs2, prop = prop2, ...} = Thm.rep_thm th2;
wenzelm@22362
   130
  in
wenzelm@22362
   131
    (case Term.fast_term_ord (prop1, prop2) of
wenzelm@22362
   132
      EQUAL =>
wenzelm@22362
   133
        (case list_ord (prod_ord Term.fast_term_ord Term.fast_term_ord) (tpairs1, tpairs2) of
wenzelm@22362
   134
          EQUAL =>
wenzelm@22362
   135
            (case list_ord Term.fast_term_ord (hyps1, hyps2) of
wenzelm@22362
   136
              EQUAL => list_ord Term.sort_ord (shyps1, shyps2)
wenzelm@22362
   137
            | ord => ord)
wenzelm@22362
   138
        | ord => ord)
wenzelm@22362
   139
    | ord => ord)
wenzelm@22362
   140
  end;
wenzelm@22362
   141
wenzelm@22682
   142
wenzelm@22682
   143
(* equality *)
wenzelm@22682
   144
wenzelm@23599
   145
fun is_reflexive th = op aconv (Logic.dest_equals (Thm.prop_of th))
wenzelm@23599
   146
  handle TERM _ => false;
wenzelm@23599
   147
wenzelm@22362
   148
fun eq_thm ths =
wenzelm@22362
   149
  Context.joinable (pairself Thm.theory_of_thm ths) andalso
wenzelm@26653
   150
  is_equal (thm_ord ths);
wenzelm@22362
   151
wenzelm@22362
   152
val eq_thms = eq_list eq_thm;
wenzelm@22362
   153
wenzelm@26665
   154
val eq_thm_thy = Theory.eq_thy o pairself Thm.theory_of_thm;
wenzelm@22362
   155
val eq_thm_prop = op aconv o pairself Thm.full_prop_of;
wenzelm@22362
   156
wenzelm@22682
   157
wenzelm@22682
   158
(* pattern equivalence *)
wenzelm@22682
   159
wenzelm@22362
   160
fun equiv_thm ths =
wenzelm@22362
   161
  Pattern.equiv (Theory.merge (pairself Thm.theory_of_thm ths)) (pairself Thm.full_prop_of ths);
wenzelm@22362
   162
wenzelm@22362
   163
wenzelm@28621
   164
(* sort hypotheses *)
wenzelm@28621
   165
wenzelm@28621
   166
fun check_shyps sorts raw_th =
wenzelm@28621
   167
  let
wenzelm@28621
   168
    val th = Thm.strip_shyps raw_th;
wenzelm@28621
   169
    val prt_sort = Syntax.pretty_sort_global (Thm.theory_of_thm th);
wenzelm@28621
   170
    val pending = Sorts.subtract sorts (Thm.extra_shyps th);
wenzelm@28621
   171
  in
wenzelm@28621
   172
    if null pending then th
wenzelm@28621
   173
    else error (Pretty.string_of (Pretty.block (Pretty.str "Pending sort hypotheses:" ::
wenzelm@28621
   174
      Pretty.brk 1 :: Pretty.commas (map prt_sort pending))))
wenzelm@28621
   175
  end;
wenzelm@28621
   176
wenzelm@28621
   177
wenzelm@22695
   178
(* misc operations *)
wenzelm@22695
   179
wenzelm@24048
   180
fun is_dummy thm =
wenzelm@24048
   181
  (case try Logic.dest_term (Thm.concl_of thm) of
wenzelm@24048
   182
    NONE => false
wenzelm@24048
   183
  | SOME t => Term.is_dummy_pattern t);
wenzelm@24048
   184
wenzelm@22695
   185
fun plain_prop_of raw_thm =
wenzelm@22695
   186
  let
wenzelm@22695
   187
    val thm = Thm.strip_shyps raw_thm;
wenzelm@22695
   188
    fun err msg = raise THM ("plain_prop_of: " ^ msg, 0, [thm]);
wenzelm@22695
   189
    val {hyps, prop, tpairs, ...} = Thm.rep_thm thm;
wenzelm@22695
   190
  in
wenzelm@22695
   191
    if not (null hyps) then
wenzelm@22695
   192
      err "theorem may not contain hypotheses"
wenzelm@22695
   193
    else if not (null (Thm.extra_shyps thm)) then
wenzelm@22695
   194
      err "theorem may not contain sort hypotheses"
wenzelm@22695
   195
    else if not (null tpairs) then
wenzelm@22695
   196
      err "theorem may not contain flex-flex pairs"
wenzelm@22695
   197
    else prop
wenzelm@22695
   198
  end;
wenzelm@22695
   199
wenzelm@22695
   200
fun fold_terms f th =
wenzelm@22695
   201
  let val {tpairs, prop, hyps, ...} = Thm.rep_thm th
wenzelm@22695
   202
  in fold (fn (t, u) => f t #> f u) tpairs #> f prop #> fold f hyps end;
wenzelm@22695
   203
wenzelm@22695
   204
wenzelm@24048
   205
(* lists of theorems in canonical order *)
wenzelm@24048
   206
wenzelm@24048
   207
val add_thm = update eq_thm_prop;
wenzelm@24048
   208
val del_thm = remove eq_thm_prop;
wenzelm@24048
   209
val merge_thms = merge eq_thm_prop;
wenzelm@24048
   210
wenzelm@24048
   211
wenzelm@22682
   212
wenzelm@24980
   213
(** basic derived rules **)
wenzelm@24980
   214
wenzelm@24980
   215
(*Elimination of implication
wenzelm@24980
   216
  A    A ==> B
wenzelm@24980
   217
  ------------
wenzelm@24980
   218
        B
wenzelm@24980
   219
*)
wenzelm@24980
   220
fun elim_implies thA thAB = Thm.implies_elim thAB thA;
wenzelm@24980
   221
wenzelm@26653
   222
wenzelm@26653
   223
(* forall_elim_var(s) *)
wenzelm@26653
   224
wenzelm@26653
   225
local
wenzelm@26653
   226
wenzelm@26653
   227
fun forall_elim_vars_aux strip_vars i th =
wenzelm@26653
   228
  let
wenzelm@26653
   229
    val thy = Thm.theory_of_thm th;
wenzelm@26653
   230
    val {tpairs, prop, ...} = Thm.rep_thm th;
wenzelm@26653
   231
    val add_used = Term.fold_aterms
wenzelm@26653
   232
      (fn Var ((x, j), _) => if i = j then insert (op =) x else I | _ => I);
wenzelm@26653
   233
    val used = fold (fn (t, u) => add_used t o add_used u) tpairs (add_used prop []);
wenzelm@26653
   234
    val vars = strip_vars prop;
wenzelm@26653
   235
    val cvars = (Name.variant_list used (map #1 vars), vars)
wenzelm@26653
   236
      |> ListPair.map (fn (x, (_, T)) => Thm.cterm_of thy (Var ((x, i), T)));
wenzelm@26653
   237
  in fold Thm.forall_elim cvars th end;
wenzelm@26653
   238
wenzelm@26653
   239
in
wenzelm@26653
   240
wenzelm@26653
   241
val forall_elim_vars = forall_elim_vars_aux Term.strip_all_vars;
wenzelm@26653
   242
wenzelm@26653
   243
fun forall_elim_var i th = forall_elim_vars_aux
wenzelm@26653
   244
  (fn Const ("all", _) $ Abs (a, T, _) => [(a, T)]
wenzelm@26653
   245
  | _ => raise THM ("forall_elim_vars", i, [th])) i th;
wenzelm@26653
   246
wenzelm@26653
   247
end;
wenzelm@26653
   248
wenzelm@26653
   249
wenzelm@26653
   250
(* unvarify: global schematic variables *)
wenzelm@26653
   251
wenzelm@24980
   252
fun unvarify th =
wenzelm@24980
   253
  let
wenzelm@24980
   254
    val thy = Thm.theory_of_thm th;
wenzelm@24980
   255
    val cert = Thm.cterm_of thy;
wenzelm@24980
   256
    val certT = Thm.ctyp_of thy;
wenzelm@24980
   257
wenzelm@24980
   258
    val prop = Thm.full_prop_of th;
wenzelm@24980
   259
    val _ = map Logic.unvarify (prop :: Thm.hyps_of th)
wenzelm@24980
   260
      handle TERM (msg, _) => raise THM (msg, 0, [th]);
wenzelm@24980
   261
wenzelm@24980
   262
    val instT0 = rev (Term.add_tvars prop []) |> map (fn v as ((a, _), S) => (v, TFree (a, S)));
wenzelm@24980
   263
    val instT = map (fn (v, T) => (certT (TVar v), certT T)) instT0;
wenzelm@24980
   264
    val inst = rev (Term.add_vars prop []) |> map (fn ((a, i), T) =>
wenzelm@24980
   265
      let val T' = TermSubst.instantiateT instT0 T
wenzelm@24980
   266
      in (cert (Var ((a, i), T')), cert (Free ((a, T')))) end);
wenzelm@24980
   267
  in Thm.instantiate (instT, inst) th end;
wenzelm@24980
   268
wenzelm@26653
   269
wenzelm@26653
   270
(* close_derivation *)
wenzelm@26653
   271
wenzelm@26628
   272
fun close_derivation thm =
wenzelm@26628
   273
  if Thm.get_name thm = "" then Thm.put_name "" thm
wenzelm@26628
   274
  else thm;
wenzelm@26628
   275
wenzelm@24980
   276
wenzelm@24980
   277
wenzelm@24980
   278
(** specification primitives **)
wenzelm@24980
   279
wenzelm@28116
   280
fun add_axiom (name, prop) thy =
wenzelm@24980
   281
  let
wenzelm@24980
   282
    val name' = if name = "" then "axiom_" ^ serial_string () else name;
wenzelm@28116
   283
    val thy' = thy |> Theory.add_axioms_i [(name', prop)];
wenzelm@28674
   284
    val axm = unvarify (Thm.axiom thy' (Sign.full_name thy' name'));
wenzelm@28116
   285
  in (axm, thy') end;
wenzelm@24980
   286
haftmann@25518
   287
fun add_def unchecked overloaded (name, prop) thy =
wenzelm@24980
   288
  let
wenzelm@24980
   289
    val tfrees = rev (map TFree (Term.add_tfrees prop []));
wenzelm@24980
   290
    val tfrees' = map (fn a => TFree (a, [])) (Name.invents Name.context Name.aT (length tfrees));
wenzelm@24980
   291
    val strip_sorts = tfrees ~~ tfrees';
wenzelm@24980
   292
    val recover_sorts = map (pairself (Thm.ctyp_of thy o Logic.varifyT)) (tfrees' ~~ tfrees);
wenzelm@24980
   293
wenzelm@24980
   294
    val prop' = Term.map_types (Term.map_atyps (perhaps (AList.lookup (op =) strip_sorts))) prop;
haftmann@25518
   295
    val thy' = Theory.add_defs_i unchecked overloaded [(name, prop')] thy;
wenzelm@28674
   296
    val axm' = Thm.axiom thy' (Sign.full_name thy' name);
wenzelm@24980
   297
    val thm = unvarify (Thm.instantiate (recover_sorts, []) axm');
wenzelm@24980
   298
  in (thm, thy') end;
wenzelm@24980
   299
wenzelm@27866
   300
wenzelm@27866
   301
wenzelm@27866
   302
(** attributes **)
wenzelm@27866
   303
wenzelm@27866
   304
fun rule_attribute f (x, th) = (x, f x th);
wenzelm@27866
   305
fun declaration_attribute f (x, th) = (f th x, th);
wenzelm@27866
   306
wenzelm@27866
   307
fun apply_attributes mk dest =
wenzelm@27866
   308
  let
wenzelm@27866
   309
    fun app [] = I
wenzelm@27866
   310
      | app ((f: attribute) :: fs) = fn (x, th) => f (mk x, th) |>> dest |> app fs;
wenzelm@27866
   311
  in app end;
wenzelm@27866
   312
wenzelm@27866
   313
val theory_attributes = apply_attributes Context.Theory Context.the_theory;
wenzelm@27866
   314
val proof_attributes = apply_attributes Context.Proof Context.the_proof;
wenzelm@27866
   315
wenzelm@27866
   316
fun no_attributes x = (x, []);
wenzelm@27866
   317
fun simple_fact x = [(x, [])];
wenzelm@27866
   318
wenzelm@27866
   319
wenzelm@27866
   320
wenzelm@27866
   321
(*** theorem tags ***)
wenzelm@27866
   322
wenzelm@27866
   323
(* add / delete tags *)
wenzelm@27866
   324
wenzelm@27866
   325
fun tag_rule tg = Thm.map_tags (insert (op =) tg);
wenzelm@27866
   326
fun untag_rule s = Thm.map_tags (filter_out (fn (s', _) => s = s'));
wenzelm@27866
   327
wenzelm@27866
   328
fun tag tg x = rule_attribute (K (tag_rule tg)) x;
wenzelm@27866
   329
fun untag s x = rule_attribute (K (untag_rule s)) x;
wenzelm@27866
   330
wenzelm@27866
   331
wenzelm@27866
   332
(* position *)
wenzelm@27866
   333
wenzelm@27866
   334
val position_of = Position.of_properties o Thm.get_tags;
wenzelm@27866
   335
wenzelm@27866
   336
fun default_position pos = Thm.map_tags (Position.default_properties pos);
wenzelm@27866
   337
val default_position_of = default_position o position_of;
wenzelm@27866
   338
wenzelm@27866
   339
wenzelm@27866
   340
(* unofficial theorem names *)
wenzelm@27866
   341
wenzelm@27866
   342
fun the_name_hint thm = the (AList.lookup (op =) (Thm.get_tags thm) Markup.nameN);
wenzelm@27866
   343
wenzelm@27866
   344
val has_name_hint = can the_name_hint;
wenzelm@27866
   345
val get_name_hint = the_default "??.unknown" o try the_name_hint;
wenzelm@27866
   346
wenzelm@27866
   347
fun put_name_hint name = untag_rule Markup.nameN #> tag_rule (Markup.nameN, name);
wenzelm@27866
   348
wenzelm@27866
   349
wenzelm@27866
   350
(* theorem groups *)
wenzelm@27866
   351
wenzelm@28017
   352
fun get_group thm = Properties.get (Thm.get_tags thm) Markup.groupN;
wenzelm@27866
   353
wenzelm@28017
   354
fun put_group name = if name = "" then I else Thm.map_tags (Properties.put (Markup.groupN, name));
wenzelm@27866
   355
wenzelm@27866
   356
fun group name = rule_attribute (K (put_group name));
wenzelm@27866
   357
wenzelm@27866
   358
wenzelm@27866
   359
(* theorem kinds *)
wenzelm@27866
   360
wenzelm@27866
   361
val axiomK = "axiom";
wenzelm@27866
   362
val assumptionK = "assumption";
wenzelm@27866
   363
val definitionK = "definition";
wenzelm@27866
   364
val theoremK = "theorem";
wenzelm@27866
   365
val lemmaK = "lemma";
wenzelm@27866
   366
val corollaryK = "corollary";
wenzelm@27866
   367
val internalK = Markup.internalK;
wenzelm@27866
   368
wenzelm@28017
   369
fun the_kind thm = the (Properties.get (Thm.get_tags thm) Markup.kindN);
wenzelm@27866
   370
wenzelm@27866
   371
val has_kind = can the_kind;
wenzelm@27866
   372
val get_kind = the_default "" o try the_kind;
wenzelm@27866
   373
wenzelm@27866
   374
fun kind_rule k = tag_rule (Markup.kindN, k) o untag_rule Markup.kindN;
wenzelm@27866
   375
fun kind k x = if k = "" then x else rule_attribute (K (kind_rule k)) x;
wenzelm@27866
   376
fun kind_internal x = kind internalK x;
wenzelm@27866
   377
fun has_internal tags = exists (fn tg => tg = (Markup.kindN, internalK)) tags;
wenzelm@27866
   378
val is_internal = has_internal o Thm.get_tags;
wenzelm@27866
   379
wenzelm@27866
   380
wenzelm@22362
   381
open Thm;
wenzelm@22362
   382
wenzelm@22362
   383
end;
wenzelm@22362
   384
wenzelm@23170
   385
val op aconvc = Thm.aconvc;
wenzelm@23170
   386
wenzelm@22362
   387
structure Thmtab = TableFun(type key = thm val ord = Thm.thm_ord);