invent_names
authorwenzelm
Thu May 31 17:57:02 2001 +0200 (2001-05-31 ago)
changeset 113537f6eff7bc97a
parent 11352 140d55f5836d
child 11354 9b80fe19407f
invent_names
src/Pure/axclass.ML
src/Pure/term.ML
     1.1 --- a/src/Pure/axclass.ML	Thu May 31 17:24:56 2001 +0200
     1.2 +++ b/src/Pure/axclass.ML	Thu May 31 17:57:02 2001 +0200
     1.3 @@ -103,8 +103,7 @@
     1.4  
     1.5  fun mk_arity (t, ss, c) =
     1.6    let
     1.7 -    val names = tl (variantlist (replicate (length ss + 1) "'", []));
     1.8 -    val tfrees = ListPair.map TFree (names, ss);
     1.9 +    val tfrees = ListPair.map TFree (Term.invent_names (length ss + 1) "'", ss);
    1.10    in Logic.mk_inclass (Type (t, tfrees), c) end;
    1.11  
    1.12  fun dest_arity tm =
     2.1 --- a/src/Pure/term.ML	Thu May 31 17:24:56 2001 +0200
     2.2 +++ b/src/Pure/term.ML	Thu May 31 17:57:02 2001 +0200
     2.3 @@ -174,6 +174,7 @@
     2.4  signature TERM =
     2.5  sig
     2.6    include BASIC_TERM
     2.7 +  val invent_names: int -> string -> string list
     2.8    val indexname_ord: indexname * indexname -> order
     2.9    val typ_ord: typ * typ -> order
    2.10    val typs_ord: typ list * typ list -> order
    2.11 @@ -735,6 +736,8 @@
    2.12        let val b' = variant used b
    2.13        in  b' :: variantlist (bs, b'::used)  end;
    2.14  
    2.15 +fun invent_names n prfx = Library.tl (variantlist (Library.replicate (n + 1) prfx, []));
    2.16 +
    2.17  
    2.18  
    2.19  (** Consts etc. **)