Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Visualize a static combinator expression
ResourceFunction["CombinatorPlot"][cmb,"FramedMatches"] highlights rule matches in the combinator expression cmb. | |
ResourceFunction["CombinatorPlot"][cmb,{"FramedPositions",posns}] highlights rule matches at given positions posns in the combinator expression cmb. | |
ResourceFunction["CombinatorPlot"][cmb,type] displays various kinds of character-based forms or array lists of cmb, depending on the type chosen. |
"Characters" | displays cmb with any specified glyphs and glyph styling |
"CharactersLeftAssociative" | displays cmb assuming left-associativity of application operator |
"CharactersRightAssociative" | displays cmb assuming right-associativity of application operator |
"CharactersPolishNotation" | displays cmb using parenthesis-free operator prefix notation |
"CharactersReversePolishNotation" | displays cmb using parenthesis-free operator postfix notation |
"ArrayList" | directly transforms cmb into a form usable in ArrayPlot |
"ArrayListLeftAssociative" | transforms left-associative form of cmb into form usable by ArrayPlot |
"ArrayListRightAssociative" | transforms right-associative form of cmb into form usable by ArrayPlot |
"ArrayListPolishNotation" | transforms Polish notation form of cmb into form usable by ArrayPlot |
"ArrayListReversePolishNotation" | transforms reverse Polish notation form of cmb into form usable by ArrayPlot |
"ArrayListBracketsOnly" | transforms bracket structure of cmb into form usable by ArrayPlot |
"SKGlyphs" | Automatic | glyphs used for S and K combinators in cmb |
"ApplicationGlyph" | "" | glyph and styles used for application operator |
"ColorCombinatorNames" | False | whether combinator names should be colored in characters form |
"CombinatorRules" | Automatic | combinator rules used to evolve cmb |
"CombinatorStyles" | Automatic | highlight/detail coloring and text style for rule matches in cmb |
"EvaluationScheme" | {"Leftmost","Outermost",1} | evaluation scheme used to evolve cmb |
"FormatFunction" | DisplayForm | function used to format character form of cmb |
"IncludeArgumentFraming" | True | whether combinator/arguments are separated in match highlighting |
"IncludeBackgroundFraming" | False | whether non-highlighted matches are shown on cmb |
"ParenthesisGlyphs" | {"(",")"} | glyphs and styles used to represent parentheses |
"UseCombinatorGlyphs" | None | which combinators should be represented with their glyphs |
Show the leftmost outermost rule match in a combinator expression:
In[1]:= |
|
Out[1]= |
|
Show all matches in a combinator expression:
In[2]:= |
|
Out[2]= |
|
Show all the rule matches in a combinator expression without showing the separation between the combinator and its arguments:
In[3]:= |
|
Out[3]= |
|
Highlight matches for a selected combinator evaluation scheme:
In[4]:= |
|
Out[4]= |
|
As well as highlighting all matches within a selected combinator evaluation scheme, indicate where all other rule matches occur:
In[5]:= |
|
Out[5]= |
|
Highlight selected positions in a combinator expression, given that the positions correspond to rule matches:
In[6]:= |
|
Out[6]= |
|
Show a combinator expression with colored combinator glyphs:
In[7]:= |
|
Out[7]= |
|
Show a combinator expression with colored combinator glyphs. Note that the Automatic value for "UseCombinatorGlyphs" sets the assumption that the CombinatorS and CombinatorK glyphs should be used for the corresponding characters:
In[8]:= |
|
Out[8]= |
|
Show a combinator expression assuming that all seven built-in combinator glyphs should be used:
In[9]:= |
|
Out[9]= |
|
Display a combinator expression in traditional form with the left-associative application operator, combinator glyphs, and styled parentheses:
In[10]:= |
|
Out[10]= |
|
Display a combinator expression in traditional form with right-associative application, combinator glyphs, and styled brackets:
In[11]:= |
|
Out[11]= |
|
Display a combinator expression in Polish (prefix) notation:
In[12]:= |
|
Out[12]= |
|
Display a combinator expression in reverse Polish (postfix) notation:
In[13]:= |
|
Out[13]= |
|
Define rules and styling for match highlighting in a combinator expression:
In[14]:= |
|
Out[14]= |
|
Return information about a combinator expression usable in an ArrayPlot; the first association contains rule match expression positions and rule numbers, the second list contains character lengths of the rule matches, the third list contains character positions at which the rule matches begin and the last list contains a form of the combinator expression that can be used in ArrayPlot:
In[15]:= |
|
Out[15]= |
|
Display an array plot for a static combinator expression:
In[16]:= |
|
Out[16]= |
|
Render an array plot of a left-associative combinator expression:
In[17]:= |
|
Out[17]= |
|
Render an array plot of a right-associative combinator expression:
In[18]:= |
|
Out[18]= |
|
Render an array plot of a combinator expression in Polish notation:
In[19]:= |
|
Out[19]= |
|
Render an array plot of a combinator expression in reverse Polish notation:
In[20]:= |
|
Out[20]= |
|
Render an array plot of a combinator expression in brackets-only form:
In[21]:= |
|
Out[21]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License