Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Enumerate possible inequivalent string substitution rules with a given signature
ResourceFunction["EnumerateSubstitutionSystemRules"][{p→q,…},n] gives all possible substitution system rules with n characters, where length-p strings are replaced with length-q strings. |
All two-character substitution system rules:
| In[1]:= |
|
| Out[1]= |
|
All two-character substitution system rules that replace length-2 strings with length-3 strings:
| In[2]:= |
|
| Out[2]= |
|
Three-character substitution system rules that replace length-3 strings with length-2 strings:
| In[3]:= |
|
| Out[3]= |
|
Three-character substitution system rules that replace length-2 strings with length-3 strings:
| In[4]:= |
|
| Out[4]= |
|
Use multiple rules:
| In[5]:= |
|
| Out[5]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License