Nested Dropping Aarex Array Notation is an seventh part of Aarex's Array Notation.
Now we need symbol in the entry, semi-colon. How ; works on the entries:
- 0{;}n = 0{0{0{...}1{;}n-1^;}1{;}n-1^;}1{;}n-1
- 0{;,m}n = 0{0{0{...}1{;,m}n-1,;,m-1}1{;,m}n-1,;,m-1}1{;,m,;,m-1}n-1
- 0{;,;}n = 0{;,0{;,0{...}1{;,;}n-1}1{;,;}n-1^;}1{;,;}n-1
;{m}n is equal to ;{m-1};{m-1};{m-1}...;{m-1}1{m}n-1, not legions of (_){m}n to avoid confusion, then AAN might go stronger.
There you go, here is the pre-definition.
Separators is the object between the entries. Let define row of Ax as separators and define the separator:
- , is the 4th-ranking separator.
- {n} is the 3rd-ranking separator.
- {a A1 b A2 c A3 ...} is the 2nd-ranking separator.
- ; on the entries is the 1st-ranking separator.
There are finite layers of the separators, so we need to define the separator layer too:
- a() array entries are the separator layer 0.
- Separators on the array A in the are the separator layer, 1 more than A.
Now here is the definition.
The nested dropping array notation look like this:
a(a,b,c A1 d A2 e...)x[y]
The integers a, b, c, etc.; are the entries, and each entry can be any number or semi-colon symbol; the Ax group are the separators where is between the entries, and the outermost "a" (like this can be place outside of the array entries) meaning this expression can be Aarex's Array Notation.
The first entry and second entry of AAN are called base and iterator, but we use numbers not symbols.
The string x[y] is optional and can be removable. x and y means nester and multiplier. Outermost a and x are always be 'a' character and 'x' character.
Note: The comma symbol ',' is shorthand for {0}, ';' on dpAAN is replaced with {;}, and {n^;}{m} is replaced with {n,;,m}, etc.
Every array needs to results in a number. To solve it, we need some rules and processes as follows:
- Rule 1: (base rule - if it have 3 entries and the 3rd entry is 0) a(a,b,0) = a*b
- Rule 1a: (if it have 2 entries) a(a,b) = a(a,b,0)
- Rule 1b: (if it have 1 entry) a(a) = a(a,1,0)
- Rule 2: (tailing rule - if the last entry is 0) # 0 = #
- Rule 3: (recursion rule - if the 3rd entry isn't 0, but there is no nester) a(a,b,c #) = a(a,b,c-1 #)x[b]
- Rule 4: (nesting-end rule - if nester and multiplier are exists and multiplier is 1) a(#)x[1] = a(#)
- English: If the nester are exists and multiplier is 1, remove 'x[1]' in the end.
- Rule 5: (nesting rule - if nester and multiplier are exists and multiplier isn't 1) a(a,b #)x[y] = a(a,a(a,b #)x[y-1] #)
where # is the part of array (a string of separators between the entries or empty string.)
If neither of 5 rules applied, start the process shown below. First, start from the third entry.
- Case A: If the entry is 0, move on to the next entry.
- Case B: If the entry is not 0:
- Define Z:
- If the previous entry is a number, use 0.
- If the previous entry is ; symbol, use ;.
- Case B1: If there is the comma in the left:
- Decrease the entry by 1.
- Change the previous entry to the iterator.
- This process ends.
- Case B2: If there is the {x #} in the left:
- Decrease the entry by 1.
- Define S0 and Sn as '1' and 'Z{x-1 #}Sn-1'
- Replace the previous entry with Sb.
- This process ends.
- Case B3: If there is the ; entry in the left:
- If the current entry is a number that is greater than 0 and separator after the entry is the comma:
- Decrease the entry by 1.
- Define l as the separator layer of S entry.
- Define S as {#} from the full separator where ; you are looking at.
- Define D as S, but all entries before first ; is removed.
- Repeat this until l = 0:
- Subtract n by 1.
- Define Ll as the separator with separator layer l where S belong to.
- Define Sl as Ll, but all entries before first ; is removed.
- Find the maximum t such as Lt that lv(D) > lv(St).
- Define S0 and Sn as '0' and 'Lt', but the entry before first ; on S on Lt will be replaced by Sn-1.
- Replace the previous entry with Sb.
- This process ends.
- Else, move on the next entry.
- Case B4: If there is the separator in the left and cases B2 & B3 did not applied:
- Decrease the entry by 1.
- Copy the separator to R.
- Replace the entry before the {#} separator with 'Z R 1'
- Continue the process within R separator, beside the process with a(x,y,z).
To compare, we need 2 functions as lv(A) and lv(B) and start at case 1. Set the comma into {0}.
- Case 1: Find the semi-colon on A and B:
- If B was ; and A not, then lv(A) < lv(B) and finish.
- If A was ; and B not, then lv(A) > lv(B) and finish.
- If A and B were all ;, then lv(A) = lv(B) and finish.
- Else, go to Case 2.
- Case 2: If A and B were all numbers, then use this case; else go to Case 3.
- If A < B, then lv(A) < lv(B) and finish.
- If A > B, then lv(A) > lv(B) and finish.
- If A = B, then lv(A) = lv(B) and finish.
- Case 3: Find the highest separator possible and call it H. Then find the amounts of H and call it A' and B'.
- If A' < B', then lv(A) < lv(B) and finish.
- If A' > B', then lv(A) > lv(B) and finish.
- If A' = B', then go into case 4.
- Case 4: Find the array preceded by the first H separator and call it A' and B'.
- If lv({A'}) < lv({B'}), then lv(A) < lv(B) and finish.
- If lv({A'}) > lv({B'}), then lv(A) > lv(B) and finish.
- If lv({A'}) = lv({B'}), then remove A' and B' and the first H separator that isn't removed, then:
- If the separator was {}, then lv(A) = lv(B) and finish.
- Else, repeat case 4.