WOLFRAM

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.

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,
  • SubstitutionSystem uses the first substitutions that apply at each step, in the same way as SequenceReplace and StringReplace.

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Five steps of a string substitution system:

Out[1]=1

Analogous substitution system with lists:

Out[2]=2

Steps in a 2D substitution system:

Out[1]=1

Give the fourth step only:

Out[2]=2

Alternative form:

Out[3]=3

Generate a rule icon for a substitution system:

Out[1]=1

Scope  (16)Survey of the scope of standard use cases

1D List Substitution Systems  (3)

Out[1]=1

Lists do not have to be the same length:

Out[2]=2

The initial condition can be of any length:

Out[1]=1

Rules can involve patterns:

Out[1]=1
Out[2]=2

Higher-Dimensional List Substitution Systems  (5)

Out[1]=1
Out[2]=2

Arrays do not have to be square:

Out[1]=1

Arrays can have any depth:

Out[1]=1

The right-hand side of a rule can be a SparseArray:

Out[1]=1

SparseArray as an initial condition:

Out[1]=1

String Substitution Systems  (2)

A string substitution system:

Out[1]=1

Use any characters in the strings:

Out[2]=2
Out[3]=3
Out[4]=4

Arrange output in a column:

Out[5]=5

Characters that do not appear in the rules are not replaced at each step:

Out[1]=1

Include additional characters in rules:

Out[2]=2

Time Step Specifications  (6)

Steps 0 through 5:

Out[1]=1

Step 5 only:

Out[1]=1

Steps 3 through 5:

Out[1]=1

Odd-numbered steps:

Out[1]=1

Apply a single step of evolution:

Out[1]=1

Apply in operator form:

Out[1]=1

Generalizations & Extensions  (1)Generalized and extended use cases

Set up neighbor-dependent string rules; rules are applied in the order given:

Out[1]=1

Applications  (3)Sample problems that can be solved with this function

Steps in constructing a Cantor set:

Out[1]=1

Create an analogous 2D nested object:

Out[2]=2

3D Menger sponge:

Out[1]=1

Generate a "C curve" fractal:

Out[1]=1

Properties & Relations  (2)Properties of the function, and connections to other functions

Approximate a Cantor staircase function:

Out[1]=1
Out[2]=2

Generate steps in a ThueMorse substitution system:

Out[1]=1

The output at each step k is given by ThueMorse[Range[0,2^k-1]:

Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

SubstitutionSystem always uses only the first substitution that applies:

Out[1]=1

Neat Examples  (2)Surprising or curious use cases

Out[1]=1

3D substitution system based on the LeviCivita tensor:

Out[1]=1
Wolfram Research (2015), SubstitutionSystem, Wolfram Language function, https://reference.wolfram.com/language/ref/SubstitutionSystem.html.
Wolfram Research (2015), SubstitutionSystem, Wolfram Language function, https://reference.wolfram.com/language/ref/SubstitutionSystem.html.

Text

Wolfram Research (2015), SubstitutionSystem, Wolfram Language function, https://reference.wolfram.com/language/ref/SubstitutionSystem.html.

Wolfram Research (2015), SubstitutionSystem, Wolfram Language function, https://reference.wolfram.com/language/ref/SubstitutionSystem.html.

CMS

Wolfram Language. 2015. "SubstitutionSystem." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SubstitutionSystem.html.

Wolfram Language. 2015. "SubstitutionSystem." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SubstitutionSystem.html.

APA

Wolfram Language. (2015). SubstitutionSystem. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubstitutionSystem.html

Wolfram Language. (2015). SubstitutionSystem. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubstitutionSystem.html

BibTeX

@misc{reference.wolfram_2025_substitutionsystem, author="Wolfram Research", title="{SubstitutionSystem}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/SubstitutionSystem.html}", note=[Accessed: 15-April-2025 ]}

@misc{reference.wolfram_2025_substitutionsystem, author="Wolfram Research", title="{SubstitutionSystem}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/SubstitutionSystem.html}", note=[Accessed: 15-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_substitutionsystem, organization={Wolfram Research}, title={SubstitutionSystem}, year={2015}, url={https://reference.wolfram.com/language/ref/SubstitutionSystem.html}, note=[Accessed: 15-April-2025 ]}

@online{reference.wolfram_2025_substitutionsystem, organization={Wolfram Research}, title={SubstitutionSystem}, year={2015}, url={https://reference.wolfram.com/language/ref/SubstitutionSystem.html}, note=[Accessed: 15-April-2025 ]}