User blog comment:Mh314159/A hopefully powerful new system/@comment-35470197-20190628050713/@comment-35470197-20190628231808

Oh, do you allow to apply the rule sets to substrings? Then you need to the order of proority of how to apply the rule sets to substrings.

For example, you have three ways to apply the rule sets to [2]\[3][4][5] in the following way: I know that you set the order c > o > ss > sn > ns > nn > base, but it does not imply the full order of the application to substrings. For example, you applied nn to the substring [3][2] of [1]\[3][2] even thought c is applicable to the substring [1]\[3] of [1]\[3][2].
 * 1) Apply nn to the substring [4][5]
 * 2) Apply nn to the substring [3][4]
 * 3) Apply nn to the substring [3][4]
 * 4) Apply c to the substring [2]\[3]

Moreover, in order to allow to apply the rule set to substrings, it is better to use a function symbol instead of writing term replacements as equalities. Namely, [a] = a should be replaced by f([n]) = n, and [n][a] = [n-1]^{[n][a-1]}[a] should be replaced by f([n+1][a+1]) = [n]^{f([n+1][a])}[a+1]. Otherwise, brackets in expressions are quite ambiguous, because it can present both unsolved expressions and results of application of the rule sets. For example, [2]\[1][2][3] can mean both a[3] and [2]\[1]b, where a is the result of c applied to [2]\[1][2] and b is the result of nn applied to [2][3]. It is another problem than the order, but a problem on the ambiguity of expressions.