This class represents a series composition over a sequence of SyntacticTerms.
Each term in the sequence is composed with the previous to form a chain
of operations. Each output is connected in order with each input of the
subsequent term. The term produced by this composition has a number of inputs
equal to that of the first term in the sequence, and a number of outputs
equal to that of the last term.
The chain is initialized as empty, and terms can be added to it either
pushing to the end, or by insertion. In these operations, checking is done
to enforce the constraint that the number of inputs and outputs are equal
at a composition. Removal is possible, although only when a term is has the
same number of inputs as outputs.
Adds a term to an arbitrary position of the series.
This is allowed only if the added term is compatible
with neighboring terms. If not at the beginning or end,
this essentially means it must have the same number of
inputs and outputs.
Removes a term from the series.
This can only be done if the neighboring terms
can be connected with each other. In the case that
this is an interior term, it must have the same number
of inputs and outputs to complete this operation.
term - Term to remove from series.
whether term has been removed.
public void intercolatePermutations()
Intercolate permutations between series terms.
public java.lang.String generateCode()
Generate code for the series.
The code for each term are joined by series composition