equal
deleted
inserted
replaced
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) = |