Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Multiway state graph of a non-deterministic generalized shift
ResourceFunction["MultiwayGeneralizedShiftGraph"][{n,shift,rewrite}, init] generates a multiway state graph of a generalized shift, defined by non-deterministic shift and rewrite rules on a window of length n over a cyclic tape, starting from the initial condition init. |
| shift | {{p1,…,pn}⧴int,…} |
| rewrite | {{p1,…,pn}⧴{r1,…,rn},…} |
| {a1,…,ak} | cyclic tape of values ai with the window initially at position 1 |
| {x,{a1,…,ak}} | cyclic tape with the window intially at position x |
Create a multiway state graph of a "universal" non-deterministic generalized shift that computes all binary sequences of length 3:
| In[1]:= |
| Out[1]= | ![]() |
Show a multiway state graph after 3 steps with improved state visualization:
| In[2]:= | ![]() |
| Out[2]= | ![]() |
Create a multiway state graph:
| In[3]:= | ![]() |
| Out[3]= | ![]() |
Identify all cyclic computations:
| In[4]:= |
| Out[4]= |
Determine the worst-case runtime to reach each state:
| In[5]:= |
| Out[5]= |
Terminate the computation at halting states:
| In[6]:= | ![]() |
| Out[7]= | ![]() |
Terminate the computation once the maximum number of steps has been reached:
| In[8]:= |
| Out[8]= | ![]() |
Randomly reduce the computational outcomes of each state, ensuring that at least one outcome remains:
| In[9]:= |
| Out[9]= | ![]() |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License