A sequential substitution system is a substitution system that applies one replacement at each step. In the rule-priority convention
used here, the whole string is scanned from left to right
for a match to the first rule. If it has no match, the whole string
is scanned for the second rule, and so on. The leftmost match of the first applicable
rule is replaced. If no rule applies, the string repeats
indefinitely for all subsequent steps (Wolfram 2002, p. 90).
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 repeatedly applying
to move a
past an
,
then applying
whenever the first rule has no match.
The system illustrated above uses rules and initial string
. Under rule priority, its first steps are
,
,
and
. In particular, the original rightmost
is replaced at the second step.
An alternative position-priority convention scans the string from left to right for the first position where any rule matches, then applies the
first matching rule there. For these same rules and initial string,
it instead gives ,
, and
.
Under this alternative convention, the rightmost
is never replaced because an earlier
or
always supplies a match.
Even under rule priority, some parts of a string can remain unchanged indefinitely. For example, the rules starting from
give
,
,
,
.... The first rule always applies, so the
is never replaced.