src/Pure/more_thm.ML
changeset 60952 762cb38a3147
parent 60951 b70c4db3874f
child 61039 80f40d89dab6
equal deleted inserted replaced
60951:b70c4db3874f 60952:762cb38a3147
    18 signature THM =
    18 signature THM =
    19 sig
    19 sig
    20   include THM
    20   include THM
    21   structure Ctermtab: TABLE
    21   structure Ctermtab: TABLE
    22   structure Thmtab: TABLE
    22   structure Thmtab: TABLE
       
    23   val eq_ctyp: ctyp * ctyp -> bool
    23   val aconvc: cterm * cterm -> bool
    24   val aconvc: cterm * cterm -> bool
       
    25   val add_tvars: thm -> ctyp list -> ctyp list
    24   val add_frees: thm -> cterm list -> cterm list
    26   val add_frees: thm -> cterm list -> cterm list
    25   val add_vars: thm -> cterm list -> cterm list
    27   val add_vars: thm -> cterm list -> cterm list
    26   val all_name: Proof.context -> string * cterm -> cterm -> cterm
    28   val all_name: Proof.context -> string * cterm -> cterm -> cterm
    27   val all: Proof.context -> cterm -> cterm -> cterm
    29   val all: Proof.context -> cterm -> cterm -> cterm
    28   val mk_binop: cterm -> cterm -> cterm -> cterm
    30   val mk_binop: cterm -> cterm -> cterm -> cterm
   108 structure Thm: THM =
   110 structure Thm: THM =
   109 struct
   111 struct
   110 
   112 
   111 (** basic operations **)
   113 (** basic operations **)
   112 
   114 
   113 (* collecting cterms *)
   115 (* collecting ctyps and cterms *)
   114 
   116 
       
   117 val eq_ctyp = op = o apply2 Thm.typ_of;
   115 val op aconvc = op aconv o apply2 Thm.term_of;
   118 val op aconvc = op aconv o apply2 Thm.term_of;
   116 
   119 
       
   120 val add_tvars = Thm.fold_atomic_ctyps (fn a => is_TVar (Thm.typ_of a) ? insert eq_ctyp a);
   117 val add_frees = Thm.fold_atomic_cterms (fn a => is_Free (Thm.term_of a) ? insert (op aconvc) a);
   121 val add_frees = Thm.fold_atomic_cterms (fn a => is_Free (Thm.term_of a) ? insert (op aconvc) a);
   118 val add_vars = Thm.fold_atomic_cterms (fn a => is_Var (Thm.term_of a) ? insert (op aconvc) a);
   122 val add_vars = Thm.fold_atomic_cterms (fn a => is_Var (Thm.term_of a) ? insert (op aconvc) a);
   119 
   123 
   120 
   124 
   121 (* cterm constructors and destructors *)
   125 (* cterm constructors and destructors *)