src/HOL/Tools/ATP/atp_util.ML
changeset 45896 100fb1f33e3e
parent 45570 6d95a66cce00
child 46385 0ccf458a3633
equal deleted inserted replaced
45895:36f3f0010b7d 45896:100fb1f33e3e
    21   val type_intersect : Proof.context -> typ -> typ -> bool
    21   val type_intersect : Proof.context -> typ -> typ -> bool
    22   val type_equiv : Proof.context -> typ * typ -> bool
    22   val type_equiv : Proof.context -> typ * typ -> bool
    23   val varify_type : Proof.context -> typ -> typ
    23   val varify_type : Proof.context -> typ -> typ
    24   val instantiate_type : theory -> typ -> typ -> typ -> typ
    24   val instantiate_type : theory -> typ -> typ -> typ -> typ
    25   val varify_and_instantiate_type : Proof.context -> typ -> typ -> typ -> typ
    25   val varify_and_instantiate_type : Proof.context -> typ -> typ -> typ -> typ
    26   val typ_of_dtyp :
    26   val typ_of_dtyp : Datatype.descr -> (Datatype.dtyp * typ) list -> Datatype.dtyp -> typ
    27     Datatype_Aux.descr -> (Datatype_Aux.dtyp * typ) list -> Datatype_Aux.dtyp
       
    28     -> typ
       
    29   val is_type_surely_finite : Proof.context -> typ -> bool
    27   val is_type_surely_finite : Proof.context -> typ -> bool
    30   val is_type_surely_infinite : Proof.context -> bool -> typ list -> typ -> bool
    28   val is_type_surely_infinite : Proof.context -> bool -> typ list -> typ -> bool
    31   val s_not : term -> term
    29   val s_not : term -> term
    32   val s_conj : term * term -> term
    30   val s_conj : term * term -> term
    33   val s_disj : term * term -> term
    31   val s_disj : term * term -> term
   146 fun varify_and_instantiate_type ctxt T1 T1' T2 =
   144 fun varify_and_instantiate_type ctxt T1 T1' T2 =
   147   let val thy = Proof_Context.theory_of ctxt in
   145   let val thy = Proof_Context.theory_of ctxt in
   148     instantiate_type thy (varify_type ctxt T1) T1' (varify_type ctxt T2)
   146     instantiate_type thy (varify_type ctxt T1) T1' (varify_type ctxt T2)
   149   end
   147   end
   150 
   148 
   151 fun typ_of_dtyp _ typ_assoc (Datatype_Aux.DtTFree a) =
   149 fun typ_of_dtyp _ typ_assoc (Datatype.DtTFree a) =
   152     the (AList.lookup (op =) typ_assoc (Datatype_Aux.DtTFree a))
   150     the (AList.lookup (op =) typ_assoc (Datatype.DtTFree a))
   153   | typ_of_dtyp descr typ_assoc (Datatype_Aux.DtType (s, Us)) =
   151   | typ_of_dtyp descr typ_assoc (Datatype.DtType (s, Us)) =
   154     Type (s, map (typ_of_dtyp descr typ_assoc) Us)
   152     Type (s, map (typ_of_dtyp descr typ_assoc) Us)
   155   | typ_of_dtyp descr typ_assoc (Datatype_Aux.DtRec i) =
   153   | typ_of_dtyp descr typ_assoc (Datatype.DtRec i) =
   156     let val (s, ds, _) = the (AList.lookup (op =) descr i) in
   154     let val (s, ds, _) = the (AList.lookup (op =) descr i) in
   157       Type (s, map (typ_of_dtyp descr typ_assoc) ds)
   155       Type (s, map (typ_of_dtyp descr typ_assoc) ds)
   158     end
   156     end
   159 
   157 
   160 fun datatype_constrs thy (T as Type (s, Ts)) =
   158 fun datatype_constrs thy (T as Type (s, Ts)) =