SubstitutionSystem

SubstitutionSystem[rule,init,t]

generates a list representing the evolution of the substitution system with the specified rule from initial condition init for t steps.

SubstitutionSystem[rule,init]

gives the result of evolving init for one step.

SubstitutionSystem[rule]

is an operator form of SubstitutionSystem that corresponds to one step of evolution.

Details

  • In SubstitutionSystem[rule,], rule can be of the following forms:
  • {i1rhs1,i2rhs2,}list substitution system
    {"s1"rhs1,"s2"rhs2,}string substitution system
  • In list substitution systems, the rhsi can be lists of any length or can be rectangular arrays of any depth but all with the same dimensions. They can also be individual elements such as integers.
  • In string substitution systems, the rhsi can be strings of any length.
  • Both lists and string substitution systems can have rules that involve patterns, but every object that appears in the rhsi must have a transformation defined by the rules given.
  • List substitution systems work with SparseArray objects.
  • In string substitution systems, the initial condition init must be a string; in list substitution systems, it must be an array whose depth is equal to the depth of the rhsi.
  • In SubstitutionSystem[rule,init,tspec], the time specification tspec can have any of the following forms:
  • tall steps 0 through t
    {t}a list containing only step t
    {t1,t2}steps t1 through t2
    {t1,t2,dt}steps t1, t1+dt,

Examples

open allclose all

Basic Examples  (3)

Five steps of a string substitution system:

In[1]:=
Click for copyable input
Out[1]=

Analogous substitution system with lists:

In[2]:=
Click for copyable input
Out[2]=

Steps in a 2D substitution system:

In[1]:=
Click for copyable input
Out[1]=

Give the fourth step only:

In[2]:=
Click for copyable input
Out[2]=

Alternative form:

In[3]:=
Click for copyable input
Out[3]=

Generate a rule icon for a substitution system:

In[1]:=
Click for copyable input
Out[1]=

Scope  (16)

Generalizations & Extensions  (1)

Applications  (3)

Properties & Relations  (2)

Neat Examples  (1)

See Also

RulePlot  NestList  Replace  StringReplace  Flatten  ArrayFlatten  ThueMorse  RudinShapiro  CellularAutomaton  AnglePath

Introduced in 2015
(10.2)