"Algebras/Pfunc/alg_outside_pfunc.gap" is the outside analogon to Algebras/Pfunc/alg_ali_pfunc.gap.
Unfortunately, ADP requires a single contiguous sub-word, for which intermediate results
are computed. To make two sub-words (0, i) and (j, n) contiguous (0 < i < j < n), we have to apply the following "trick": we
duplicate the input sequence but separate both copies with a special character, e. g.
original input ccaaagg
becomes ccaaagg+ccaaagg
. Since
everything is duplicated, sub-word (0, i) for the leading half is identical to (n+1, n+1+i).
Concatenated with the trailing half (j, n) and the separator character (n, n + 1), we get
the contiguous sub-word (j, n)+(n + 1, n + 1 + i), for which we can apply any ADP
computation.
Since algebra functions are commonly used by another algebra (Algebras/Pfunc/alg_ali_pfunc.gap), they are outsourced in the file Algebras/Pfunc/algpart_ali_pfunc_basic.gap.