Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Visualize the evolution of a combinator expression
ResourceFunction["CombinatorEvolutionPlot"][evol, type] renders the combinator evolution evol according to the specified type of visualization. |
"StatesDisplay" | displays the combinator evolution in a list, or multiple combinator evolutions in a list of lists, in a stylized way |
"ExpressionDepthPlot" | displays an array plot showing the depths of subexpressions throughout the combinator evolution |
"SizeAndMatches" | visualizes the leaf count of expressions and which leaves are changed by which rule at each step in evolution |
"UpdateDepthPlot" | visualizes the depth at which rule applications occur relative to the overall leaf counts at each step in evolution |
"DepthAndUpdatePlot" | visualizes depths of subexpressions throughout the combinator evolution, as well as which leaves are changed by which rule in evolution |
"DepthCuboidPlot" | visualizes depths of subexpressions throughout the combinator evolution in 3D, as well as which leaves are changed by which rule in evolution |
"ArrayPlot" | displays an array plot of evol |
"ArrayPlotLeftAssociative" | displays an array plot wherein the application operator is left associative |
"ArrayPlotRightAssociative" | displays an array plot wherein the application operator is right associative |
"ArrayPlotBracketsOnly" | displays an array plot wherein only the brackets are shown |
"ArrayPlotPolishNotation" | displays an array plot wherein each step is written in Polish notation |
"ArrayPlotReversePolishNotation" | displays an array plot wherein each step is written in reverse Polish notation |
"SpanThickness" | 0.2 | the thickness of match indicator line in "SizeAndMatches", "DepthAndUpdatePlot" |
"IncludeDepthAxis" | False | whether to show expression depth in 3D in "ExpressionDepthPlot" |
"DisplayStyles" | Automatic | styling for rendering evol in a grid in "StatesDisplay" |
"IncludeUpdateHighlighting" | True | whether updates are indicated in "DepthCuboidPlot" |
"UpdateHighlightingStyles" | Automatic | styling for update highlighting |
Display the fixed-point evolution of a combinator expression:
In[1]:= |
|
Out[1]= |
|
Generate a plot showing the position depths in each expression of the combinator evolution:
In[2]:= |
|
Out[2]= |
|
Show the expression depths of the combinator evolution in 3D:
In[3]:= |
|
Out[3]= |
|
Show the leaf count and position/type of the matches throughout the combinator evolution:
In[4]:= |
|
Out[4]= |
|
Show the total depth of the combinator expressions and the depth at which the updates occur:
In[5]:= |
|
Out[5]= |
|
Show the leaf count, depth of subexpressions, and position and type of the matches throughout the combinator evolution:
In[6]:= |
|
Out[6]= |
|
Visualize the same information from the previous example in 3D:
In[7]:= |
|
Out[7]= |
|
Display an ArrayPlot of the combinator evolution in standard form:
In[8]:= |
|
Out[8]= |
|
Display an ArrayPlot of the combinator evolution with left associative combinator application:
In[9]:= |
|
Out[9]= |
|
Display an ArrayPlot of the combinator evolution with right associative combinator application:
In[10]:= |
|
Out[10]= |
|
Display an ArrayPlot of the combinator evolution with only the brackets kept in each expression:
In[11]:= |
|
Out[11]= |
|
Display an ArrayPlot of the combinator evolution in Polish notation:
In[12]:= |
|
Out[12]= |
|
Display an ArrayPlot of the combinator evolution in reverse Polish notation:
In[13]:= |
|
Out[13]= |
|
Display a combinator evolution with left associative combinator application:
In[14]:= |
|
Out[14]= |
|
Add styling to the same rendering of the combinator evolution:
In[15]:= |
|
Out[15]= |
|
Display a combinator expression evolved via two different evaluation schemes:
In[16]:= |
|
Out[16]= |
|
Display a combinator evolution with match framing at each step:
In[17]:= |
|
Out[17]= |
|
Define the color rules for an ArrayPlot of a combinator evolution in reverse Polish notation:
In[18]:= |
|
Out[18]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License