src/HOL/Tools/res_clause.ML
changeset 24322 dc7336b8c54c
parent 24310 af4af9993922
child 24937 340523598914
equal deleted inserted replaced
24321:e9d99744e40c 24322:dc7336b8c54c
    41     | Comp of string * fol_type list
    41     | Comp of string * fol_type list
    42   val string_of_fol_type : fol_type -> string
    42   val string_of_fol_type : fol_type -> string
    43   datatype type_literal = LTVar of string * string | LTFree of string * string
    43   datatype type_literal = LTVar of string * string | LTFree of string * string
    44   val mk_typ_var_sort: typ -> typ_var * sort
    44   val mk_typ_var_sort: typ -> typ_var * sort
    45   exception CLAUSE of string * term
    45   exception CLAUSE of string * term
    46   val init : theory -> unit
       
    47   val isMeta : string -> bool
    46   val isMeta : string -> bool
    48   val add_typs_aux : (typ_var * string list) list -> type_literal list * type_literal list
    47   val add_typs_aux : (typ_var * string list) list -> type_literal list * type_literal list
    49   val get_tvar_strs: (typ_var * sort) list -> string list
    48   val get_tvar_strs: (typ_var * sort) list -> string list
    50   datatype arLit =
    49   datatype arLit =
    51       TConsLit of class * string * string list
    50       TConsLit of class * string * string list
   264 
   263 
   265 
   264 
   266 exception CLAUSE of string * term;
   265 exception CLAUSE of string * term;
   267 
   266 
   268 
   267 
   269 (*Declarations of the current theory--to allow suppressing types.*)
       
   270 val const_typargs = ref (Library.K [] : (string*typ -> typ list));
       
   271 
       
   272 fun num_typargs(s,T) = length (!const_typargs (s,T));
       
   273 
       
   274 (*Initialize the type suppression mechanism with the current theory before
       
   275     producing any clauses!*)
       
   276 fun init thy = (const_typargs := Sign.const_typargs thy);
       
   277 
       
   278 
       
   279 (*Flatten a type to a fol_type while accumulating sort constraints on the TFrees and
   268 (*Flatten a type to a fol_type while accumulating sort constraints on the TFrees and
   280   TVars it contains.*)
   269   TVars it contains.*)
   281 fun type_of (Type (a, Ts)) =
   270 fun type_of (Type (a, Ts)) =
   282       let val (folTyps, ts) = types_of Ts
   271       let val (folTyps, ts) = types_of Ts
   283           val t = make_fixed_type_const a
   272           val t = make_fixed_type_const a