<<MultiwaySystems`Multiway`
Length/@XMWEvolveList[{"ABB"->"BBA","BAA"->"ABAB"},"ABAAB",50]
{1,1,1,1,1,1,1,2,1,1,1,2,2,3,3,4,4,4,4,4,4,5,6,7,7,8,9,9,8,9,10,11,11,13,14,15,15,16,16,17,18,19,20,22,23,24,25,26,27,28,29}
Length/@XMWEvolveList[{"ABB"->"BBA","BAA"->"ABAB"},"ABAAB",200]
{1,1,1,1,1,1,1,2,1,1,1,2,2,3,3,4,4,4,4,4,4,5,6,7,7,8,9,9,8,9,10,11,11,13,14,15,15,16,16,17,18,19,20,22,23,24,25,26,27,28,29,31,32,34,35,37,38,40,41,43,44,46,48,50,51,53,56,58,59,61,64,66,67,70,72,75,77,80,82,85,87,90,92,95,98,101,104,107,110,113,116,119,122,126,129,133,136,140,143,147,150,154,158,163,166,170,175,179,182,186,191,196,200,205,210,215,219,224,228,233,238,244,249,255,260,266,271,276,281,287,293,299,305,312,318,324,330,336,342,349,355,362,369,377,383,390,397,405,411,418,426,434,441,449,457,465,473,481,489,497,505,514,522,531,539,549,558,567,575,585,594,603,612,622,632,642,652,662,672,682,692,702,712,724,734,745,756,768,778,789,800,812,823,835,847,859,871,883,895,907,919}
Differences[%]
{0,0,0,0,0,0,1,-1,0,0,1,0,1,0,1,0,0,0,0,0,1,1,1,0,1,1,0,-1,1,1,1,0,2,1,1,0,1,0,1,1,1,1,2,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,2,2,1,2,3,2,1,2,3,2,1,3,2,3,2,3,2,3,2,3,2,3,3,3,3,3,3,3,3,3,3,4,3,4,3,4,3,4,3,4,4,5,3,4,5,4,3,4,5,5,4,5,5,5,4,5,4,5,5,6,5,6,5,6,5,5,5,6,6,6,6,7,6,6,6,6,6,7,6,7,7,8,6,7,7,8,6,7,8,8,7,8,8,8,8,8,8,8,8,9,8,9,8,10,9,9,8,10,9,9,9,10,10,10,10,10,10,10,10,10,10,12,10,11,11,12,10,11,11,12,11,12,12,12,12,12,12,12,12}
Differences[%]
{0,0,0,0,0,1,-2,1,0,1,-1,1,-1,1,-1,0,0,0,0,1,0,0,-1,1,0,-1,-1,2,0,0,-1,2,-1,0,-1,1,-1,1,0,0,0,1,-1,0,0,0,0,0,0,1,-1,1,-1,1,-1,1,-1,1,-1,1,0,0,-1,1,1,-1,-1,1,1,-1,-1,2,-1,1,-1,1,-1,1,-1,1,-1,1,0,0,0,0,0,0,0,0,0,1,-1,1,-1,1,-1,1,-1,1,0,1,-2,1,1,-1,-1,1,1,0,-1,1,0,0,-1,1,-1,1,0,1,-1,1,-1,1,-1,0,0,1,0,0,0,1,-1,0,0,0,0,1,-1,1,0,1,-2,1,0,1,-2,1,1,0,-1,1,0,0,0,0,0,0,0,1,-1,1,-1,2,-1,0,-1,2,-1,0,0,1,0,0,0,0,0,0,0,0,0,2,-2,1,0,1,-2,1,0,1,-1,1,0,0,0,0,0,0,0}
ListPlot[%11,PlotJoinedTrue];
MWEvolveList[{"ABB"->"BBA","BAA"->"ABAB"},{"ABAAB"},400];
Length/@%
{1,1,1,1,1,1,1,2,1,1,1,2,2,3,3,4,4,4,4,4,4,5,6,7,7,8,9,9,8,9,10,11,11,13,14,15,15,16,16,17,18,19,20,22,23,24,25,26,27,28,29,31,32,34,35,37,38,40,41,43,44,46,48,50,51,53,56,58,59,61,64,66,67,70,72,75,77,80,82,85,87,90,92,95,98,101,104,107,110,113,116,119,122,126,129,133,136,140,143,147,150,154,158,163,166,170,175,179,182,186,191,196,200,205,210,215,219,224,228,233,238,244,249,255,260,266,271,276,281,287,293,299,305,312,318,324,330,336,342,349,355,362,369,377,383,390,397,405,411,418,426,434,441,449,457,465,473,481,489,497,505,514,522,531,539,549,558,567,575,585,594,603,612,622,632,642,652,662,672,682,692,702,712,724,734,745,756,768,778,789,800,812,823,835,847,859,871,883,895,907,919,932,945,958,970,984,997,1010,1022,1036,1050,1064,1077,1092,1106,1120,1134,1148,1162,1177,1192,1207,1222,1238,1253,1268,1283,1299,1314,1330,1346,1363,1379,1396,1412,1429,1445,1462,1479,1496,1513,1531,1549,1567,1584,1602,1621,1639,1656,1675,1694,1713,1731,1751,1770,1790,1809,1829,1848,1868,1888,1908,1928,1949,1970,1991,2012,2033,2054,2075,2096,2118,2139,2162,2184,2207,2229,2252,2274,2297,2319,2342,2366,2390,2413,2437,2462,2486,2509,2533,2558,2583,2607,2633,2658,2684,2709,2735,2760,2786,2812,2839,2865,2892,2919,2946,2973,3000,3027,3055,3083,3111,3139,3168,3196,3225,3253,3282,3311,3341,3370,3400,3430,3461,3490,3520,3551,3582,3612,3643,3675,3707,3738,3770,3802,3834,3866,3899,3931,3964,3997,4031,4064,4098,4131,4166,4200,4234,4268,4303,4338,4373,4408,4444,4480,4516,4552,4588,4624,4661,4697,4734,4771,4810,4847,4885,4923,4962,4999,5037,5076,5115,5154,5194,5234,5274,5314,5354,5394,5434,5474,5516,5557,5599,5640,5683,5725,5767,5808,5851,5894,5937,5980,6024,6068,6112,6156,6200,6244,6289,6334}
Differences[%]
{0,0,0,0,0,0,1,-1,0,0,1,0,1,0,1,0,0,0,0,0,1,1,1,0,1,1,0,-1,1,1,1,0,2,1,1,0,1,0,1,1,1,1,2,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,2,2,1,2,3,2,1,2,3,2,1,3,2,3,2,3,2,3,2,3,2,3,3,3,3,3,3,3,3,3,3,4,3,4,3,4,3,4,3,4,4,5,3,4,5,4,3,4,5,5,4,5,5,5,4,5,4,5,5,6,5,6,5,6,5,5,5,6,6,6,6,7,6,6,6,6,6,7,6,7,7,8,6,7,7,8,6,7,8,8,7,8,8,8,8,8,8,8,8,9,8,9,8,10,9,9,8,10,9,9,9,10,10,10,10,10,10,10,10,10,10,12,10,11,11,12,10,11,11,12,11,12,12,12,12,12,12,12,12,13,13,13,12,14,13,13,12,14,14,14,13,15,14,14,14,14,14,15,15,15,15,16,15,15,15,16,15,16,16,17,16,17,16,17,16,17,17,17,17,18,18,18,17,18,19,18,17,19,19,19,18,20,19,20,19,20,19,20,20,20,20,21,21,21,21,21,21,21,21,22,21,23,22,23,22,23,22,23,22,23,24,24,23,24,25,24,23,24,25,25,24,26,25,26,25,26,25,26,26,27,26,27,27,27,27,27,27,28,28,28,28,29,28,29,28,29,29,30,29,30,30,31,29,30,31,31,30,31,32,32,31,32,32,32,32,33,32,33,33,34,33,34,33,35,34,34,34,35,35,35,35,36,36,36,36,36,36,37,36,37,37,39,37,38,38,39,37,38,39,39,39,40,40,40,40,40,40,40,40,42,41,42,41,43,42,42,41,43,43,43,43,44,44,44,44,44,44,45,45}
Differences[%]
{0,0,0,0,0,1,-2,1,0,1,-1,1,-1,1,-1,0,0,0,0,1,0,0,-1,1,0,-1,-1,2,0,0,-1,2,-1,0,-1,1,-1,1,0,0,0,1,-1,0,0,0,0,0,0,1,-1,1,-1,1,-1,1,-1,1,-1,1,0,0,-1,1,1,-1,-1,1,1,-1,-1,2,-1,1,-1,1,-1,1,-1,1,-1,1,0,0,0,0,0,0,0,0,0,1,-1,1,-1,1,-1,1,-1,1,0,1,-2,1,1,-1,-1,1,1,0,-1,1,0,0,-1,1,-1,1,0,1,-1,1,-1,1,-1,0,0,1,0,0,0,1,-1,0,0,0,0,1,-1,1,0,1,-2,1,0,1,-2,1,1,0,-1,1,0,0,0,0,0,0,0,1,-1,1,-1,2,-1,0,-1,2,-1,0,0,1,0,0,0,0,0,0,0,0,0,2,-2,1,0,1,-2,1,0,1,-1,1,0,0,0,0,0,0,0,1,0,0,-1,2,-1,0,-1,2,0,0,-1,2,-1,0,0,0,0,1,0,0,0,1,-1,0,0,1,-1,1,0,1,-1,1,-1,1,-1,1,0,0,0,1,0,0,-1,1,1,-1,-1,2,0,0,-1,2,-1,1,-1,1,-1,1,0,0,0,1,0,0,0,0,0,0,0,1,-1,2,-1,1,-1,1,-1,1,-1,1,1,0,-1,1,1,-1,-1,1,1,0,-1,2,-1,1,-1,1,-1,1,0,1,-1,1,0,0,0,0,0,1,0,0,0,1,-1,1,-1,1,0,1,-1,1,0,1,-2,1,1,0,-1,1,1,0,-1,1,0,0,0,1,-1,1,0,1,-1,1,-1,2,-1,0,0,1,0,0,0,1,0,0,0,0,0,1,-1,1,0,2,-2,1,0,1,-2,1,1,0,0,1,0,0,0,0,0,0,0,2,-1,1,-1,2,-1,0,-1,2,0,0,0,1,0,0,0,0,0,1,0}
ListPlot[%,PlotJoinedTrue];