In[]:=
GraphDistanceMatrix[ResourceFunction["MultiwaySystem"][{"A""AB","BB""A"},{"A"},5,"StatesGraph"]]
Out[]=
{{0,1,2,3,3,4,4,4,5,5,5,5},{∞,0,1,2,2,3,3,3,4,4,4,4},{∞,∞,0,1,1,2,2,2,3,3,3,3},{∞,∞,∞,0,∞,1,1,∞,2,2,2,∞},{∞,∞,∞,∞,0,1,1,1,2,2,2,2},{∞,∞,∞,∞,∞,0,∞,∞,1,1,∞,∞},{∞,∞,∞,∞,∞,∞,0,∞,∞,1,1,∞},{∞,∞,∞,∞,∞,∞,∞,0,1,1,1,1},{∞,∞,∞,∞,∞,∞,∞,∞,0,∞,∞,∞},{∞,∞,∞,∞,∞,∞,∞,∞,∞,0,∞,∞},{∞,∞,∞,∞,∞,∞,∞,∞,∞,∞,0,∞},{∞,∞,∞,∞,∞,∞,∞,∞,∞,∞,∞,0}}
In[]:=
pathlengths[rule_,init_,steps_]:=Association[With[{g=ResourceFunction["MultiwaySystem"][rule,init,steps,"StatesGraph"]},SortBy[Sort[Thread[VertexList[g]->GraphDistance[g,init]]],StringLength[First[#]]&]]]
In[]:=
stringslist[max_,k_:2]:=Flatten[With[{aa=StringTake[ToUpperCase[StringJoin[Alphabet[]]],k]},Table[ResourceFunction["StringTuples"][aa,i],{i,max}]]]
In[]:=
pathlengths[{"A""AB","BB""A"},"A",10]
Out[]=
A0,AA3,AB1,AAA6,AAB4,ABA4,ABB2,AAAA9,AAAB7,AABA7,AABB5,ABAA7,ABAB5,ABBA5,ABBB3,AAAAB10,AAABA10,AAABB8,AABAA10,AABAB8,AABBA8,AABBB6,ABAAA10,ABAAB8,ABABA8,ABABB6,ABBAA8,ABBAB6,ABBBA6,ABBBB4,AAABBB9,AABABB9,AABBAB9,AABBBA9,AABBBB7,ABAABB9,ABABAB9,ABABBA9,ABABBB7,ABBAAB9,ABBABA9,ABBABB7,ABBBAA9,ABBBAB7,ABBBBA7,ABBBBB5,AAABBBB10,AABABBB10,AABBABB10,AABBBAB10,AABBBBA10,AABBBBB8,ABAABBB10,ABABABB10,ABABBAB10,ABABBBA10,ABABBBB8,ABBAABB10,ABBABAB10,ABBABBA10,ABBABBB8,ABBBAAB10,ABBBABA10,ABBBABB8,ABBBBAA10,ABBBBAB8,ABBBBBA8,ABBBBBB6,AABBBBBB9,ABABBBBB9,ABBABBBB9,ABBBABBB9,ABBBBABB9,ABBBBBAB9,ABBBBBBA9,ABBBBBBB7,AABBBBBBB10,ABABBBBBB10,ABBABBBBB10,ABBBABBBB10,ABBBBABBB10,ABBBBBABB10,ABBBBBBAB10,ABBBBBBBA10,ABBBBBBBB8,ABBBBBBBBB9,ABBBBBBBBBB10
In[]:=
stringslist[5]
Out[]=
{A,B,AA,AB,BA,BB,AAA,AAB,ABA,ABB,BAA,BAB,BBA,BBB,AAAA,AAAB,AABA,AABB,ABAA,ABAB,ABBA,ABBB,BAAA,BAAB,BABA,BABB,BBAA,BBAB,BBBA,BBBB,AAAAA,AAAAB,AAABA,AAABB,AABAA,AABAB,AABBA,AABBB,ABAAA,ABAAB,ABABA,ABABB,ABBAA,ABBAB,ABBBA,ABBBB,BAAAA,BAAAB,BAABA,BAABB,BABAA,BABAB,BABBA,BABBB,BBAAA,BBAAB,BBABA,BBABB,BBBAA,BBBAB,BBBBA,BBBBB}
In[]:=
ListPlot[%235/@stringslist[5]]
Out[]=
In[]:=
%235/@stringslist[5]
Out[]=
{0,Missing[KeyAbsent,B],3,1,Missing[KeyAbsent,BA],Missing[KeyAbsent,BB],6,4,4,2,Missing[KeyAbsent,BAA],Missing[KeyAbsent,BAB],Missing[KeyAbsent,BBA],Missing[KeyAbsent,BBB],9,7,7,5,7,5,5,3,Missing[KeyAbsent,BAAA],Missing[KeyAbsent,BAAB],Missing[KeyAbsent,BABA],Missing[KeyAbsent,BABB],Missing[KeyAbsent,BBAA],Missing[KeyAbsent,BBAB],Missing[KeyAbsent,BBBA],Missing[KeyAbsent,BBBB],Missing[KeyAbsent,AAAAA],10,10,8,10,8,8,6,10,8,8,6,8,6,6,4,Missing[KeyAbsent,BAAAA],Missing[KeyAbsent,BAAAB],Missing[KeyAbsent,BAABA],Missing[KeyAbsent,BAABB],Missing[KeyAbsent,BABAA],Missing[KeyAbsent,BABAB],Missing[KeyAbsent,BABBA],Missing[KeyAbsent,BABBB],Missing[KeyAbsent,BBAAA],Missing[KeyAbsent,BBAAB],Missing[KeyAbsent,BBABA],Missing[KeyAbsent,BBABB],Missing[KeyAbsent,BBBAA],Missing[KeyAbsent,BBBAB],Missing[KeyAbsent,BBBBA],Missing[KeyAbsent,BBBBB]}
In[]:=
ResourceFunction["EnumerateSubstitutionSystemRules"][{12,21},2]
Out[]=
{{AAA,AAA},{AAA,AAB},{AAA,ABA},{AAA,ABB},{AAA,BBA},{AAA,BBB},{AAB,AAA},{AAB,AAB},{AAB,ABA},{AAB,ABB},{AAB,BAA},{AAB,BAB},{AAB,BBA},{AAB,BBB},{ABB,AAA},{ABB,AAB},{ABB,ABA},{ABB,ABB},{ABB,BBA},{ABB,BBB}}
In[]:=
Function[ru,With[{p=pathlengths[ru,"A",4]},ListPlot[ReplaceAll[p/@stringslist[5],_Missing0],FrameTrue,PlotStyleLarge,PlotRangeAll]]]/@ResourceFunction["EnumerateSubstitutionSystemRules"][{12,21},2]
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
In[]:=
makepix[rulelist_,init_,t_,smax_]:=Function[ru,With[{p=pathlengths[ru,init,t]},ListPlot[ReplaceAll[p/@stringslist[smax],_Missing0],FrameTrue,PlotStyleLarge,PlotRangeAll]]]/@rulelist
In[]:=
makepix[{{"B""ABA","AA""B","BB""A"}},"B",8,4]
Out[]=
In[]:=
makepix[{{"B""ABA","AA""B","BB""A"}},"B",15,4]
“Picking up theorems as one goes”
“Picking up theorems as one goes”
Which theorems are worth picking up?
Caching theorems found so far?
Eventually all strings are reached:
Causal dependece
Causal dependece
Interpretations of geodesics
Interpretations of geodesics
[[ Doubled paths are because the highlighting was done with subgraph ]]
Explicit equalities
Explicit equalities
Need to get to an obvious tautology......