User blog:Kyodaisuu/Converting pair sequence to ordinal

As I implemented a function to determine if Bashicu Matrix is standard in BM calculator, now I am trying to implement ordinal conversion.

Koteitan made a Pair sequence to Buchholz's Ψ function in four lines Javascript, and I read the code and translated. Actually I think koteitan's code only works for the standard form of pair sequence. In the BM calculator, standard form is checked and therefore I can just exclude non-standard form. Converting something like

(e_1)w^((e_1)w^(e_1)) = w^((e_1)^2)

is not fully implemented.

The code converts the BM to omega and epsilon expression when ordinal is below zeta_0. It would be convenient because people are used to this kind of ordinal expression. Right now I just wrote a test code and paste the result here to verify before actually implementing it.

Legend: w = ω, e = ε, p = ψ (Buchholz)


 * (0)(0)(1) = Not standard
 * (0) = 1
 * (0)(0)(0)(0)(0)(0) = 6
 * (0)(1)(0)(0) = w+2
 * (0)(1)(0)(1)(0)(1) = w+w+w
 * (0)(1)(1)(1) = w^3
 * (0)(1)(2) = w^w
 * (0)(1)(2)(3) = w^w^w
 * (0)(1)(2)(3)(2)(3) = w^(w^(w+w))
 * (0)(1)(2)(3)(3)(0)(0)(0) = w^w^w^2+3
 * (0)(1)(2)(3)(4)(2)(3) = w^(w^(w^w+w))
 * (0)(1)(2)(3)(4)(5)(6)(2)(1)(2)(3)(3)(0)(1)(2) = w^(w^(w^w^w^w+1)+w^w^2)+w^w
 * (0,0)(1,1)(1,0)(0,0) = (e_0)w+1
 * (0,0)(1,1)(1,0)(1,0) = (e_0)w^2
 * (0,0)(1,1)(1,0)(2,0) = (e_0)w^w
 * (0,0)(1,1)(1,0)(2,1) = (e_0)w^(e_0)
 * (0,0)(1,1)(1,0)(2,1)(2,0) = (e_0)w^((e_0)w)
 * (0,0)(1,1)(1,0)(2,1)(2,0)(3,1) = (e_0)w^((e_0)w^(e_0))
 * (0,0)(1,1)(1,1) = e_1
 * (0,0)(1,1)(1,1)(1,0)(2,1)(2,1)(2,0)(3,1)(3,1) = (e_1)w^((e_1)w^(e_1))
 * (0,0)(1,1)(1,1)(1,1)(1,1) = e_3
 * (0,0)(1,1)(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)(5,1)(3,0) = e_((e_(e_0))w)
 * (0,0)(1,1)(2,0)(3,1)(4,0)(5,1)(4,0) = e_(e_((e_0)w))
 * (0,0)(1,1)(2,0)(3,1)(4,0)(5,1)(5,0) = e_(e_((e_0)w^((e_0)w)))
 * (0,0)(1,1)(2,0)(3,1)(4,0)(5,1)(6,0) = e_(e_(e_w))
 * (0,0)(1,1)(2,0)(3,1)(4,0)(5,1)(6,0)(6,0) = e_(e_(e_(w^2)))
 * (0,0)(1,1)(2,0)(3,1)(4,0)(5,1)(6,0)(7,0) = e_(e_(e_(w^w)))
 * (0,0)(1,1)(2,0)(3,1)(4,0)(5,1)(6,0)(7,1) = e_(e_(e_(e_0)))
 * (0,0)(1,1)(2,1) = p0(p1(p1(0)))
 * (0,0)(1,1)(2,1)(1,1) = p0(p1(p1(0))+p1(0))
 * (0,0)(1,1)(2,1)(2,1) = p0(p1(p1(0)+p1(0)))
 * (0,0)(1,1)(2,1)(3,1) = p0(p1(p1(p1(0))))
 * (0,0)(1,1)(2,2) = p0(p1(p2(0)))
 * (0,0)(1,1)(2,2)(0,0) = p0(p1(p2(0)))+1
 * (0,0)(1,1)(2,2)(1,0) = (p0(p1(p2(0))))w
 * (0,0)(1,1)(2,2)(1,1) = p0(p1(p2(0))+p1(0))
 * (0,0)(1,1)(2,2)(2,0) = p0(p1(p2(0)+p0(0)))
 * (0,0)(1,1)(2,2)(2,1) = p0(p1(p2(0)+p1(0)))
 * (0,0)(1,1)(2,2)(2,2) = p0(p1(p2(0)+p2(0)))
 * (0,0)(1,1)(2,2)(3,0) = p0(p1(p2(p0(0))))
 * (0,0)(1,1)(2,2)(3,1) = p0(p1(p2(p1(0))))
 * (0,0)(1,1)(2,2)(3,2) = p0(p1(p2(p2(0))))
 * (0,0)(1,1)(2,2)(3,3) = p0(p1(p2(p3(0))))
 * (0,0,0)(1,1,1)(1,0,0)(0,0,0)(0,0,0) = ((0,0,0)(1,1,1))w+2