IsWord( obj )
IsWord returns true if the object obj, which may be an object of
arbitrary type, is a word and false otherwise. Signals an error if
obj is an unbound variable.
gap> a := AbstractGenerator("a");;
gap> b := AbstractGenerator("b");;
gap> w := (a^2*b)^5*b^-1;
a^2*b*a^2*b*a^2*b*a^2*b*a^2
gap> IsWord( w );
true
gap> a := (1,2,3);;
gap> IsWord( a^2 );
false
GAP 3.4.4