Given words u and v, and a generator x, belonging to a semigroup S, return the word obtained from u by replacing each occurrence of x by v.
Suppose u and v are words belonging to the same semigroup S, and that f is an integer such that 1 ≤f ≤# u. If v is a subword of u, the function returns true, as well as the least integer l such that:If no such l is found, Match returns only false.
- (a)
- l≥f; and,
- (b)
- v appears as a subword of u, starting at the l-th letter of u.
A random word of length l in the generators of the semigroup S, where m ≤l ≤n.
The word obtained by cyclically permuting the word u by n places. If n is positive, the rotation is from left to right, while if n is negative the rotation is from right to left. In the case where n is zero, the function returns u.
Given words u and v belonging to a semigroup S, and non-negative integers f and n, this function replaces the substring of u of length n, starting at position f, by the word v. Thus, if u = xi1 ... xif ... x_(if + n - 1) ... xim then the substring xif ... x_(if + n - 1) is replaced by v. If u and v belong to a monoid M and the function is invoked with v = Id(M), then the substring xif ... x_(if + n - 1) of u is deleted.
The subword of the word u comprising the n consecutive letters commencing at the f-th letter of u.
The sequence obtained by decomposing u into the indices of its constituent generators. Thus, if u = xi1 ... xim, then the sequence constructed by ElementToSequence is [i1, i2, ..., im].