I made some changes on R function II, and get this version. The strength still remains the same.

## Definition

### Syntax

Symbol { is called *lbrace*, with ASCII=123, LaTeX=\{ or \lbrace.

Symbol } is called *rbrace*, with ASCII=125, LaTeX=\} or \rbrace.

Symbol + is called *plus*, with ASCII=43.

The *brace* can be defined as follows:

- String {
^{+m}} where "+m" is at the superscript position and m is a nonnegative integer is a brace. This m is called the*brace rank*of that brace. - String {A
_{1}A_{2}...A_{k}^{+m}} is a brace iff all the A_{1}, A_{2}, ..., A_{k}are brace. And its brace rank is m, too.

A *separator* is a brace with brace rank > 0.

The *standard form* of R function is nRA_{1}A_{2}...A_{k}, where -

- n is a positive integer, here called "base number"
- R is a symbol for the function
- All the A
_{1}, A_{2}, ..., A_{k}are braces but not separators. k=0 is allowed too, which means the string after R is empty.

And there're some shorthands:

- The superscript "+0" can be omitted, and the superscript "+1" can be written as "+".
- {
^{+1}} can be also written as a comma.

### Main process

Scan and apply rules. Case A1, A2, D and E are terminal, but A3, B and C are not. After you apply a terminal rule, you'll return here, then you can choose any R to start scanning.

Scanning starts at the R symbol. Scan from left to right. Scan braces at the same nested level. Before scanning, set s = 0 (that's for case D).

- Case A: If there's a {},
- Case A1: If R is immediately before it, then apply \(nR\{\}\odot=(\cdots(nR\odot) R\odot\cdots) R\odot\) with n \(R\odot\)'s. And return.
- Case A2: If an lbrace is immediately before it, then apply \(\{\{\}\odot\}=\{\odot\}\{\odot\}\cdots\{\odot\}\) with n \(\{\odot\}\)'s (here n is the base number). And return.
- Case A3: If a separator is immediately before it, then apply \(\{\odot\}\{\}=\{\odot\}\{\}\{\odot\}\), add s by 1 then set A
_{s}= \(\{\odot\}\), then scan inside the first \(\{\odot\}\).

- Case B: If there's a brace neither a separator nor the {}, add s by 1 then set A
_{s}to that brace, then continue scanning inside it. - Case C: If there's a separator, ignore it and continue scanning.
- Case D: If there's no more braces you can scan, and you meet "
^{+m}}" with m > 0,

- Let brace S
_{s}be such that the rbrace of the "^{+m}}" is the rbrace of it, set t = s - Repeat this:
- Subtract t by 1
- Let S
_{t}be the brace such that "nested level of S_{t}= nested level of S_{t+1}- 1" and "S_{t+1}is inside S_{t}" - If t = 1, then break the repeating, or else continue repeating.

- Set k = m, s(m) = s, B(m) = {
^{+(m-1)}}, string X(m) = "{" and Y(m) = "{}^{+(m-1)}}". - Repeat this:
- Subtract k by 1
- Set s(k) = s(k+1)
- Repeat this:
- Subtract s(k) by 1
- If level of A
_{s(k)}< level of A_{s(k+1)}, then break the repeating, or else continue repeating.

- If level of A
_{s(k)}< level of B(k+1), then let string P and Q be such that A_{1}= P A_{s(k)+1}Q, then change the original brace A_{1}into P X(k+1) A_{s(k)+1}Y(k+1) Q,**and return**. Or else - - If k = 0, then break the repeating, or else -
- Let string X(k) and Y'(k) be such that S
_{s(k)}= X(k) S_{s(k+1)}{} Y'(k), set Y(k) = {} Y'(k) and set B(k) = X(k) Y'(k).

- Let string P and Q be such that S
_{s(0)}= P S_{s(1)}Q, then apply S_{s(0)}= P P ... P P Q Q ... Q Q with n P's and n Q's, and return.

- Case E: If there's nothing you can scan, and nothing is after you, change the whole expression into 2^n where n is the base number, and return.

The \(\odot\) can be any string or empty.

### Subrule

It's actually a property of the main process. But it's necessary when comparing levels.

- \(\{\odot_1\{\odot_2^{+a}\}^{+b}\}=\{\odot_1^{+b}\}\) where a>0
- AB = B where A and B are separator and level of A < level of B (this one is just an approximation)

### Levels

First, {} has the lowest level, and others have higher level. The same braces have the same level.

Then, we can compare the level of A and B as follows, if there's no separator inside A or B.

- Let A = {A
_{1}A_{2}...A_{c}^{+a}} and B = {B_{1}B_{2}...B_{d}^{+b}}, where A_{i}'s and B_{i}'s are braces. - If brace rank of A > brace rank of B then A>B on level; If brace rank of A < brace rank of B then A<B on level. or else -
- Compare levels of A
_{i}'s and find highest-level ones - A_{M}. And the same as B. - If level of A
_{M}> B_{M}, then A>B; if A_{M}< B_{M}, then A<B. or else - - If the amount of A
_{M}> B_{M}, then A>B; if the amount of A_{M}< B_{M}, then A<B. or else - - Delete string after the first A
_{M}(including) and before the rbrace of A (excluding), and the same as B. We make two reduced braces: A' and B'. - If level of A' > B', then A > B; if A' < B' , then A < B; if A' = B' , then A = B.

Finally, we can compare the level of A and B as follows:

- Use subrule on A and B until the subrule cannot apply any more.
- If brace rank of A > brace rank of B then A>B on level; If brace rank of A < brace rank of B then A<B on level. or else -
- All the separators of A are {A
_{1}}, {A_{2}},... {A_{n}}. And the same as B. - Compare levels of {A
_{i}}'s and find highest-level ones - {A_{M}}. And the same as B. - If level of {A
_{M}}>{B_{M}}, then A>B; if {A_{M}}<{B_{M}}, then A<B. or else - - If the amount of {A
_{M}}>{B_{M}}, then A>B; if the amount of {A_{M}}<{B_{M}}, then A<B. or else - - Find the last {A
_{M}} of A, and A={A^{-}{A_{M}}A^{+}} and the same as B. - If the level of {A
^{+}}>{B^{+}}, then A>B; if {A^{+}}<{B^{+}}, then A<B. or else - - If the level of {A
^{-}}>{B^{-}}, then A>B; if {A^{-}}<{B^{-}}, then A<B; if {A^{-}}={B^{-}}, then A=B.