22.1 AbstractGenerator

AbstractGenerator( string )

AbstractGenerator returns a new abstract generator. This abstract generator is printed using the string string passed as argument to AbstractGenerator.

    gap> a := AbstractGenerator( "a" );
    a
    gap> a^5;
    a^5 

Note that the string is only used to print the abstract generator and to order abstract generators (see Comparisons of Words). It is possible for two different abstract generators to use the same string and still be different.

    gap> b := AbstractGenerator( "a" );
    a
    gap> a = b;
    false 

Also when you define abstract generators interactively it is a good idea to use the identifier of the variable as the name of the abstract generator, because then what GAP will output for a word is equal to what you can input to obtain this word. The following is an example of what you should probably not do.

    gap> c := AbstractGenerator( "d" );
    d
    gap> d := AbstractGenerator( "c" );
    c
    gap> (c*d)^3;
    d*c*d*c*d*c
    gap> d*c*d*c*d*c;
    c*d*c*d*c*d 

Up Top Next
Index

GAP 3.4.4
April 1997