[Max’s local evolution representation]
[Max’s local evolution representation]
In[]:=
Graph[treeEvolutionGraph=Graph[{DirectedEdge[s[s][s][s][s],s[s][s][s],0],DirectedEdge[s[s][s][s],s[s][s],0],DirectedEdge[s[s][s],s[s],0],DirectedEdge[s[s],s,0],DirectedEdge[s[s][s][s][s],s,1],DirectedEdge[s[s][s][s],s,1],DirectedEdge[s[s][s],s,1],DirectedEdge[s[s],s,1],DirectedEdge[s[s][s][s][s],s[s][s[s]][s]],DirectedEdge[s[s][s[s]][s],s[s][s[s]],0],DirectedEdge[s[s][s[s]][s],s,1],DirectedEdge[s[s][s[s]],s[s],0],DirectedEdge[s[s][s[s]],s[s],1],DirectedEdge[s[s][s[s]][s],s[s][s[s][s]]],DirectedEdge[s[s][s[s][s]],s[s],0],DirectedEdge[s[s][s[s][s]],s[s][s],1]},EdgeStyle{DirectedEdge[_,_,0]Hue[.33,.8,.8],DirectedEdge[_,_,1]Hue[.67,.8,.8],DirectedEdge[_,_]Hue[0,.8,.8]}],VertexLabelsAutomatic]
Out[]=
In[]:=
eeee=SKOuterEvolveList[s[s][s][s[s]][s][s],10]//Last
Out[]=
s[s[s[s]][s[s[s[s]][s]][s]]][s[s][s[s[s]][s[s[s[s]][s]][s]]][s[s[s[s]][s[s[s[s]][s]][s]]]][s[s[s[s]][s[s[s[s]][s]][s]]]]]
In[]:=
Union[Level[eeee,{0,Infinity},HeadsTrue]]
Out[]=
{s,s[s],s[s[s]],s[s[s[s]][s]],s[s[s[s]][s[s[s[s]][s]][s]]],s[s][s[s[s]][s[s[s[s]][s]][s]]],s[s[s]][s],s[s[s]][s[s[s[s]][s]][s]],s[s[s[s]][s]][s],s[s[s[s]][s[s[s[s]][s]][s]]][s[s][s[s[s]][s[s[s[s]][s]][s]]][s[s[s[s]][s[s[s[s]][s]][s]]]][s[s[s[s]][s[s[s[s]][s]][s]]]]],s[s][s[s[s]][s[s[s[s]][s]][s]]][s[s[s[s]][s[s[s[s]][s]][s]]]],s[s][s[s[s]][s[s[s[s]][s]][s]]][s[s[s[s]][s[s[s[s]][s]][s]]]][s[s[s[s]][s[s[s[s]][s]][s]]]]}
In[]:=
ToDAG[expr_]:=Graph[Catenate[Function[e,MapIndexed[DirectedEdge[e,#,First[#2]-1]&,Level[e,{1},HeadsTrue]]]/@Union[Level[expr,{0,Infinity},HeadsTrue]]],EdgeStyle{DirectedEdge[_,_,0]Directive[Darker[Red],Thick],DirectedEdge[_,_,1]Hue[.67,.8,.8],DirectedEdge[_,_,"Evolution"]Directive[Red,Dotted]}]
In[]:=
Graph[ToDAG[eeee],VertexLabels{v_StandardForm[Text[v]]}]
Out[]=
In[]:=
Clear[DAGCompletion,DAGEvolutionEdges,SKDAGList]
In[]:=
SKDAGList[expr_,t_]:=Graph[#,EdgeStyle{DirectedEdge[_,_,0]Directive[Darker[Red],Thick],DirectedEdge[_,_,1]Hue[.67,.8,.8],DirectedEdge[_,_,"Evolution"]Directive[Red,Dotted]}]&/@NestList[GraphUnionApply[DAGCompletion]@GraphUnionApply[DAGEvolutionEdges]@#&,DAGCompletion[Graph[{expr},{}]],t]
In[]:=
DAGEvolutionEdges[graph_]:=DirectedEdge[#,Replace[#,{s[x_][y_][z_]x[z][y[z]],k[x_][y_]x}],"Evolution"]&/@Select[VertexList[graph],MatchQ[s[_][_][_]|k[_][_]]]
In[]:=
GraphUnionApply[f_][g_]:=GraphUnion[g,f[g]]
In[]:=
DAGCompletion[g_]:=Catenate[Function[e,MapIndexed[DirectedEdge[e,#,First[#2]-1]&,Level[e,{1},HeadsTrue]]]/@Union[Catenate[Level[#,{0,Infinity},HeadsTrue]&/@VertexList[g]]]]
In[]:=
DAGUpstreamUpdate[g_]:=VertexInComponent[g,#,{1}]&/@(First/@EdgeList[g,DirectedEdge[_,_,"Evolution"]])
In[]:=
DAGUpstreamUpdate
Out[]=
{{s[s][s][s[s]][s]}}
In[]:=
SKDAGList[s[s][s][s[s]][s][s],4]
Out[]=
,
,
,
,
[ cf IPFS ]
New Version
New Version
Testing
Testing
Procedure: follow the expression edges, then when you are at the point for an update, follow an update edge ; then go backwards on the corresponding
Anything unreachable from the “current root” can be garbage collected.....
Minimized multiway system ::: orange+dotted arrows are like states graph........
[[ k and s are specific vertices ... ]]
Depth-first search in the DAG,
Does the Y combinator make a loop here?
Does the Y combinator make a loop here?