library(strings) defines three predicates for generating atoms.
), where N is the next number in the sequence associated with Prefix. Notionally, each Prefix has its own counter, starting with zero. Prefix must be an atom. Examples:
| ?- gensym(a, X). X = a1 | ?- gensym(a, X). X = a2 | ?- gensym(b, X). X = b1 | ?- gensym(1, X). no
| ?- gensym(X). X = '%58'
gensym/2. Otherwise, Prefix and Atom should be atoms. The name is to be read as "conditionally generate symbol".
These predicates are included for compatibility with the DEC-10 Prolog
library, which has contained them for several years.
cgensym/2 will do nothing to Atom if it is already bound; otherwise it
is just like