A sequential substitution system is a substitution system in which a string is scanned from left to right for the first occurrence
of the first rule pattern. If the pattern is found, the rule is applied and processing
advances to the next step. If the first rule pattern does not occur, the string is
scanned from left to right for the first occurrence of the second rule pattern. If
the pattern is found, the rule is applied and processing advances to the next step,
and so on. If none of the rule patterns match at some step, the string repeats indefinitely
for all subsequent steps. For example, consider the single rule and the initial string
, illustrated above. The first step yields
, the second step yields
, and from there on the system repeats since there are no
more matches of the pattern rule.
A more interesting sequential substitution system is illustrated above (Wolfram 2002, p. 90). This
system has two rules and the initial condition
. It builds increasingly long runs of sequential
s followed by sequential
s by temporarily taking away one
before adding two more at the last step of each cycle.
In systems with two or more rules, it is possible for some parts of a string to never be replaced as a result of another substitution always occurring first in a left-to-right
scan. For example, consider the rules and the initial string
. The first step yields
by replacing the first
. The second step yields
by replacing the first
. The third step yields
by replacing the first
, and so on. This sequential substitution system will never
replace the rightmost
because it will always be preceded by either
or
. As a result, it builds ever longer trailing strings of
s.