# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Generate a graph of branch pair ancestry for a nondeterministic Turing machine "glocal" (hybrid of global and local) multiway system

Contributed by:
Jonathan Gorard

ResourceFunction["TuringMachineGlocalBranchialGraph"][ generates the graph of branch pair ancestry after | |

ResourceFunction["TuringMachineGlocalBranchialGraph"][ uses the function |

Glocal multiway systems combine the global events (and the corresponding causal structure) of ordinary multiway systems, with the individual token philosophy of local multiway systems. A single event vertex in the evolution causal graph (or token event graph) will, in general, have many incoming and outgoing evolution edges, corresponding to the fact that several tokens must be assembled together in order to reconstruct a single global input or output state for the event.

The branchial graph for a glocal multiway system shows the branch pair (i.e. critical pair) ancestry for a glocal evolution causal graph/token event graph. Unlike the branchial graph for an ordinary (global) multiway system, which only contains information regarding the evolution ancestry of states, glocal branchial graphs contain information about both the causal ancestry of events and the evolution ancestry of states/tokens.

Argument and option patterns for ResourceFunction["TuringMachineGlocalBranchialGraph"] match those of the resource function MultiwayTuringMachine (and, to a lesser extent, the resource function MultiwaySystem).

ResourceFunction["TuringMachineGlocalBranchialGraph"] accepts both individual Turing machine rules and lists of rules, and likewise for initial conditions. ResourceFunction["TuringMachineGlocalBranchialGraph"][*rules*,*init*,*n*] is interpreted as ResourceFunction["TuringMachineGlocalBranchialGraph"][*rules*,{*init*},*n*], etc.

The event selection function *sel* in ResourceFunction["TuringMachineGlocalBranchialGraph"][*rules*→*sel*,…] can have the following special forms:

"Sequential" | applies the first possible replacement (sequential substitution system) |

"Random" | applies a random replacement |

{"Random",n} | applies n randomly chosen replacements |

Duplicated tokens are displayed separately at each time step by default, although this can be overridden by setting "DeduplicateTokens"→True.

Events are represented in the form {*rule*,*input*,*rest*}, where *rule* is the rule used in the updating event, *input* is the part of the state to which the rule is applied and *rest* is the remainder of the state. For substitution systems, *rest* is given in the form {*prefix*,*suffix*}.

Options for ResourceFunction["TuringMachineGlocalBranchialGraph"] include:

"DeduplicateTokens" | False | whether to merge all instances of equivalent tokens that appear at each time step |

"VertexRendering" | True | whether to use special rendering for state/token and event vertices |

"IncludeInitializationEvents" | False | whether to include pseudoevents that set up initial conditions |

"StateRenderingFunction" | Automatic | how to label states/tokens that appear in the evolution causal graph/token event graph |

"EventRenderingFunction" | Automatic | how to label events that appear in the evolution causal graph/token event graph |

All of the standard options for the Graph function can also be applied to ResourceFunction["TuringMachineGlocalBranchialGraph"].

Possible settings for "StateRenderingFunction" and "EventRenderingFunction" include:

Automatic | make a label from the name of the vertex |

Inherited | use the explicit vertex name as the label |

None | use no label for the vertex |

"string" | use a shape from the VertexShapeFunction collection |

func | apply the function func to the name of the vertex |

Generate glocal branchial graphs for two simple nondeterministic Turing machine (2-state, 2-color machines) evolutions:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Show just the structure of the graphs without labels:

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

Merge all instances of equivalent tokens that appear at each time step:

In[5]:= |

Out[5]= |

Run the system for more steps:

In[6]:= |

Out[6]= |

Show just the structure of the graphs, without labels:

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

Specify an event selection function that picks only up to two events at each step:

In[9]:= |

Out[9]= |

TuringMachineGlocalBranchialGraph accepts both single Turing machine IDs and lists of Turing machine IDs:

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

Simulating 3-state, 2-color machines:

In[12]:= |

Out[12]= |

TuringMachineGlocalBranchialGraph accepts both individual initial conditions and lists of initial conditions:

In[13]:= |

Out[13]= |

In[14]:= |

Out[14]= |

Apply only the first possible event at each step:

In[15]:= |

Out[15]= |

Apply the first and last possible events at each step:

In[16]:= |

Out[16]= |

Compare this to the full branchial graph for the unrestricted glocal multiway evolution:

In[17]:= |

Out[17]= |

By default, equivalent tokens remain unmerged at each time step:

In[18]:= |

Out[18]= |

Merging of equivalent tokens at each time step can be enforced using the option "DeduplicateTokens":

In[19]:= |

Out[19]= |

By default, state/token vertices and event vertices use special rendering (inherited from the MultiwayTuringMachine resource function):

In[20]:= |

Out[20]= |

This rendering can be disabled using the option "VertexRendering":

In[21]:= |

Out[21]= |

By default, states/tokens are labeled by their contents:

In[22]:= |

Out[22]= |

Use no labeling for states/tokens:

In[23]:= |

Out[23]= |

Use raw state/token names as vertex labels:

In[24]:= |

Out[24]= |

Use a named shape as each state/token label:

In[25]:= |

Out[25]= |

By default, both states/tokens and events are labeled by their contents:

In[26]:= |

Out[26]= |

Use no labeling for states/tokens:

In[27]:= |

Out[27]= |

Also use no labeling for events:

In[28]:= |

Out[28]= |

Disabling vertex rendering yields an equivalent result:

In[29]:= |

Out[29]= |

Use raw event expressions as their labels:

In[30]:= |

Out[30]= |

Generate an example glocal branchial graph for a multiway Turing machine evolution:

In[31]:= |

Out[31]= |

Force a spring embedding (as opposed to the default spring electrical embedding):

In[32]:= |

Out[32]= |

- The Wolfram Physics Project
- Stephen Wolfram's A New Kind of Science | Online
- Multiway System–Wolfram MathWorld

- 1.0.0 – 14 December 2021

This work is licensed under a Creative Commons Attribution 4.0 International License