User blog:Chronolegends/improved Egg Notation


 * Improved Egg Notation

This is a notational and functional upgrade of my previous blog 

Note: A change in the encoding renders strings from this version and the previous incompatible.


 * Concepts


 * Eggs
 * A pair of grouping symbols
 * Egg whites separation between egg groups inside eggs, represented by a comma ,


 * Egg colors
 * Red =
 * Blue = []
 * Green = {}


 * Egg groups
 * Contiguous Eggs


 * Syntax Rules
 * There may be no red egg to the left of a non-red egg. Example: [] is invalid
 * The above rule also applies to eggs inside other eggs
 * There is at least one red egg
 * A Blue Egg may contain Red Eggs or Green Eggs, but not both.
 * Green Eggs must be inside a Blue Egg or a Green Egg
 * When there are only Red Eggs, the notation has ended


 * Symbol glossary
 * R(n) = n copies of
 * B(X) = [X]
 * G(X) = {X}
 * A^n(Y) = A...A(Y) for n A's
 * Lower case letters = non-negative integers
 * X = Valid egg combinations.
 * Z = Valid egg combinations, but Z's are always independent of other Z's, for example when copied, Z's produce independent outputs for each copy.


 * Rules
 * 1.- BR(a) → R(a+1)
 * Description: Empty Blue Eggs are replaced with one Red Egg
 * 2.- B(R(a+1))R(b)→ B^b(R(a))
 * Description: Blue Eggs with one or more Red Egg inside are replaced with an amount of Blue Eggs equal to the Red Eggs to the right of the cracked egg, the new Blue Eggs have the same contents as the cracked egg, except for 1 less Red Egg.
 * Note: B(X) → R(n), thus R(n) also implies possible B(X) of equal value, for example, this is the reason the rules for things like  B(a)B(b) and  B(B(R(a)))R(b) are implicit
 * P(X) = G(Z,X)
 * 3.- B(P^n(G(X,R(a+1)))R(b) → B^b(P^n(X,R(a))R(b)
 * 4.- B(P^n(G(X,))R(b)       → B(P^n(Q(G(X,)),b))R(b)
 * Q(X,b)
 * X = G(,R(a)) → R(a+1)
 * X = G(R(a+1),) → G(R(a),b)
 * X = G(Y,) → Q(Y,b)
 * G(Y,0) = G(Y,)
 * G(Y,n+1) = G(Y,(G,n))