src/Pure/drule.ML
changeset 59759 cb1966f3a92b
parent 59647 c6f413b660cf
child 59773 3adf5d1c02f6
equal deleted inserted replaced
59756:96abba46955f 59759:cb1966f3a92b
    56   val generalize: string list * string list -> thm -> thm
    56   val generalize: string list * string list -> thm -> thm
    57   val list_comb: cterm * cterm list -> cterm
    57   val list_comb: cterm * cterm list -> cterm
    58   val strip_comb: cterm -> cterm * cterm list
    58   val strip_comb: cterm -> cterm * cterm list
    59   val strip_type: ctyp -> ctyp list * ctyp
    59   val strip_type: ctyp -> ctyp list * ctyp
    60   val beta_conv: cterm -> cterm -> cterm
    60   val beta_conv: cterm -> cterm -> cterm
    61   val types_sorts: thm -> (indexname-> typ option) * (indexname-> sort option)
       
    62   val flexflex_unique: Proof.context option -> thm -> thm
    61   val flexflex_unique: Proof.context option -> thm -> thm
    63   val export_without_context: thm -> thm
    62   val export_without_context: thm -> thm
    64   val export_without_context_open: thm -> thm
    63   val export_without_context_open: thm -> thm
    65   val store_thm: binding -> thm -> thm
    64   val store_thm: binding -> thm -> thm
    66   val store_standard_thm: binding -> thm -> thm
    65   val store_standard_thm: binding -> thm -> thm
   170 fun beta_conv x y =
   169 fun beta_conv x y =
   171   Thm.dest_arg (Thm.cprop_of (Thm.beta_conversion false (Thm.apply x y)));
   170   Thm.dest_arg (Thm.cprop_of (Thm.beta_conversion false (Thm.apply x y)));
   172 
   171 
   173 
   172 
   174 
   173 
   175 (*** Find the type (sort) associated with a (T)Var or (T)Free in a term
       
   176      Used for establishing default types (of variables) and sorts (of
       
   177      type variables) when reading another term.
       
   178      Index -1 indicates that a (T)Free rather than a (T)Var is wanted.
       
   179 ***)
       
   180 
       
   181 fun types_sorts thm =
       
   182   let
       
   183     val vars = Thm.fold_terms Term.add_vars thm [];
       
   184     val frees = Thm.fold_terms Term.add_frees thm [];
       
   185     val tvars = Thm.fold_terms Term.add_tvars thm [];
       
   186     val tfrees = Thm.fold_terms Term.add_tfrees thm [];
       
   187     fun types (a, i) =
       
   188       if i < 0 then AList.lookup (op =) frees a else AList.lookup (op =) vars (a, i);
       
   189     fun sorts (a, i) =
       
   190       if i < 0 then AList.lookup (op =) tfrees a else AList.lookup (op =) tvars (a, i);
       
   191   in (types, sorts) end;
       
   192 
       
   193 
       
   194 
       
   195 
       
   196 (** Standardization of rules **)
   174 (** Standardization of rules **)
   197 
   175 
   198 (*Generalization over a list of variables*)
   176 (*Generalization over a list of variables*)
   199 val forall_intr_list = fold_rev Thm.forall_intr;
   177 val forall_intr_list = fold_rev Thm.forall_intr;
   200 
   178