Words in free ZG-modules

AddFreeWords
AddFreeWords(v,w)

Inputs two words v,w in a free ZG-module and returns their sum v+w. If the characteristic of Z is greater than 0 then the next function might be more efficient.
AddFreeWordsModP
AddFreeWordsModP(v,w,p)

Inputs two words v,w in a free ZG-module and the characteristic p of Z. It returns the sum v+w. If p=0 the previous function might be fractionally quicker.
AlgebraicReduction
AlgebraicReduction(w)
AlgebraicReduction(w,p)

Inputs a word w in a free ZG-module and returns a reduced version of the word in which all pairs of mutually inverse letters have been cancelled. The reduction is performed in a free abelian group unless the characteristic p of Z is entered.
MultiplyWord
Multiply Word(n,w)

Inputs a word w and integer n. It returns the scalar multiple n\cdot w.
Negate
Negate([i,j])

Inputs a pair [i,j] of integers and returns [-i,j].
NegateWord
NegateWord(w)

Inputs a word w in a free ZG-module and returns the negated word -w.
PrintZGword
PrintZGword(w,elts)

Inputs a word w in a free ZG-module and a (possibly partial but sufficient) listing elts of the elements of G. The function prints the word w to the screen in the form

r_1E_1 + \ldots + r_nE_n

where r_i are elements in the group ring ZG, and E_i denotes the i-th free generator of the module.
TietzeReduction
TietzeReduction(S,w)

Inputs a set S of words in a free ZG-module, and a word w in the module. The function returns a word w' such that {S,w'} generates the same abelian group as {S,w}. The word w' is possibly shorter (and certainly no longer) than w. This function needs to be improved!