User:Wythagoras/Dollar function/Linear Array Notation

Linear Array Notation is the third part of Dollar Function. It has eight rules, and four symbols, and a rule to define active bracket.

Definition in words
\(\bullet\) can be anything

\(\circ\) is the remaining array

\(\diamond\) is a group of zeroes.

\(\blacktriangledown\) is enclosing something.

Start scanning from the right to the left. Start at the end.
 * If there is nothing after the $, the value of the array is the number for the $.

Otherwise, continue scanning until you find a number. The bracket to the right of the number is the active bracket, unless the number is between two commas. If so, that array is active. Also scan in levels if you come across them.
 * If you have an number on the base level, add it to the number before the $.
 * If the active bracket contains a number larger than zero, it spawns a brackets with the number decreased by one.
 * If the active bracket contains a zero:
 * If it is not the only content, remove the zero.
 * If it has no level (level 1), it spawns to the number a. (\([0] = a\))
 * If the first entry of its level contains a non-nested number, and its level is \(b\bullet\), find the nearest bracket enclosing the active bracket with level \(b-1\bullet\) and only one entry. Delete the active bracket, and replace it with a-1 copies of the bracket with level \(b-1\bullet\) inside each other, including the content. (there are a brackets of level \(b-1\bullet\) in total). At the gap where first the active bracket was, place an [0].
 * If there isn't one add it, directly enclosing the active bracket.
 * If the first entry of the level is a zero, decrease the first non-zero by one and nest the level's bracket a times in the previous array.

Definition in formulas
Scan from the right to the left until you find a number. The bracket to the right of the number is the active bracket. Also scan in levels if you come across them.

1. \(a\$ = a\)

2. \(a\$\bullet b = a+b\$\bullet\)

3. \([b\bullet]_{\circ} = [b-1\bullet]_{\circ}[b-1\bullet]_{\circ}...[b-1\bullet]_{\circ}[b-1\bullet]_{\circ}\)

4. \([0\bullet]_{\circ} = [\bullet]_{\circ}\) if \(\bullet\) isn't empty

5. \([0] = a\)

6. \([\blacktriangledown[0]_{b\bullet}\blacktriangledown]_{b-1\bullet} = [\blacktriangledown[\blacktriangledown[\blacktriangledown[\blacktriangledown...[\blacktriangledown[0]\blacktriangledown]_{b-1\bullet}...\blacktriangledown]_{b-1\bullet}\blacktriangledown]_{b-1\bullet}\blacktriangledown]_{b-1\bullet}\blacktriangledown]_{b-1\bullet}\) with a+1 pairs of brackets in total and if there isn't such bracket, add it, directly enclosing the \([0]_{b\bullet}\) bracket.

7. \([0]_{\diamond,0,b,\circ} = [0]_{\diamond,[0]_{\diamond,[0]_{\diamond,...,b-1,\circ},b-1,\circ},b-1,\circ}\)

Analysis
The analysis is not very large, but it is still in a seperate page: Analysis