src/Pure/term.ML
changeset 2138 056dead45ae8
parent 1460 5a6f2aabd538
child 2146 6854b692f1fe
equal deleted inserted replaced
2137:afc15c2fd5b5 2138:056dead45ae8
   470 
   470 
   471 
   471 
   472 (*Makes a variant of the name c distinct from the names in bs.
   472 (*Makes a variant of the name c distinct from the names in bs.
   473   First attaches the suffix "a" and then increments this. *)
   473   First attaches the suffix "a" and then increments this. *)
   474 fun variant bs c : string =
   474 fun variant bs c : string =
   475   let fun vary2 c = if (c mem bs) then  vary2 (bump_string c)  else  c
   475   let fun vary2 c = if (c mem_string bs) then  vary2 (bump_string c)  else  c
   476       fun vary1 c = if (c mem bs) then  vary2 (c ^ "a")  else  c
   476       fun vary1 c = if (c mem_string bs) then  vary2 (c ^ "a")  else  c
   477   in  vary1 (if c="" then "u" else c)  end;
   477   in  vary1 (if c="" then "u" else c)  end;
   478 
   478 
   479 (*Create variants of the list of names, with priority to the first ones*)
   479 (*Create variants of the list of names, with priority to the first ones*)
   480 fun variantlist ([], used) = []
   480 fun variantlist ([], used) = []
   481   | variantlist(b::bs, used) = 
   481   | variantlist(b::bs, used) =