Having constructed a rewrite monoid M one can perform arithmetic with words in M. Assuming we have u, v in M then the product u * v will be computed as follows:
Product of the words w and v.
The n-th power of the word w, where n is a positive or zero integer.
Given words w and v belonging to the same monoid, return true if w and v reduce to the same normal form, false otherwise. If M is confluent this tests for equality. If M is non-confluent then two words which are the same may not reduce to the same normal form.
Given words w and v belonging to the same monoid, return false if w and v reduce to the same normal form, true otherwise. If M is confluent this tests for non-equality. If M is non-confluent then two words which are the same may reduce to different normal forms.
True if the word w is the identity word.
The length of the word w.
The sequence Q obtained by decomposing the element u of a rewrite monoid into its constituent generators. Suppose u is a word in the rewrite monoid M. If u = M.i_1 ... M.i_m, then Q[j] = i_j, for j = 1, ..., m.
> FM<a,A,b,B,c,C,d,D,e,E> := FreeMonoid(10); > Q := quo< FM | a*A=1, A*a=1, b*B=1, B*b=1, c*C=1, > C*c=1, d*D=1, D*d=1, e*E=1, E*e=1, > a*b=c, b*c=d, c*d=e, d*e=a, e*a=b>; > M<a,A,b,B,c,C,d,D,e,E> := RWSMonoid(Q); > print a*b*c*d; E > print (c*d)^4 eq a; true > print IsIdentity(a*A); true > print #(d*a*(B*b)^10); 1