User:Syst3ms/STON 2 : up to BMS ?

WORK IN PROGRESS.
Definition of \(\text{lev}(s)\) :
 * 1) If \(s=s_1+s_2\) with \(s_1\in T,s_2\in PT\) then \(\text{lev}(s)=0\)
 * 2) Else if \(s=\mu(a)\) :
 * 3) If \(\text{cof}(a)\leq\omega\) then \(\text{lev}(s)=\psi_{\mu(0)}(a)\)
 * 4) Otherwise, \(\text{lev}(s)=0\)
 * 5) Else if \(s=\psi_a(b))\) :
 * 6) If \(0<\text{lev}(\text{lev}(a))\) :
 * 7) If \(\omega<\text{cof}(b)\wedge\text{cof}(n)\leq a\) then \(\text{lev}(s)=0\)
 * 8) Else if \(a=V\wedge b=0\) then \(\text{lev}(s)=1\)
 * 9) Else if \(a=\mu(c)\wedge\text{cof}(c)=\omega\) :
 * 10) If \(b=b_1+b_2\) with \(b_1 \notin ST\wedge b_2<\omega\) then \(\text{lev}(s)=\text{lev}(a)[\text{lev}(\mu(\text{pred}(b_2)))]\)
 * 11) Otherwise, \(\text{lev}(s)=0\)
 * 12) Else if \(b=b1+b2\) with \(b_1\in T,b_2\in PT\) then  \(\text{lev}(s)=\text{lev}(\psi_a(b_2))\)
 * 13) Else if \(b=\psi_c(d)\wedge\text{lev}(c)=1\wedge\text{cof}(\psi_c(d))\leq\omega\) :
 * 14) If \(a=mu(e)\wedge e \in ST\) :
 * 15) If \(c\leq d\) then \(\text{lev}(s)=\mu(\text{pre}(e))+\nu_c(d)\), where \(\nu_p(s)\) is defined as such :
 * 16) \(\nu_p(0)=0\)
 * 17) Else if \(s=d+e\) with \(d\in PT,e\in T\) then \(\nu(s)=\nu_p(d)+\nu_p(e)\)
 * 18) Else if \(p\leq\text{cof}(s)\) then \(\nu_p(s)=\nu_p(S(\psi_p(s)))\)
 * 19) Otherwise, \(\nu_p(s)=s\)
 * 20) Else if \(d=0\) then \(\mu(\text{pre}(e))\)
 * 21) Otherwise, \(\text{lev}(s)=\mu(\text{pre}(e))+d\)
 * 22) Else if \(a=\mu(e)\wedge\text{cof}(e)=\omega\wedge\omega<\text{cof}(d)\) then \(\text{lev}(s)=0\)
 * 23) Else if \(d=0\) then \(\text{lev}(s)=0\)
 * 24) Else if \(c\leq d\) then \(\text{lev}(s)=\nu_c(d)\)
 * 25) Else if \(\omega\leq d\) then \(\text{lev}(s)=d\)
 * 26) Otherwise, \(\text{lev}(s)=d+1\)
 * 27) Else if \(\text{lev}(a) \in ST\) then \(\text{lev}(s)=\text{pre}(\text{lev}(a))\)
 * 28) Else if \(b=b_1+b_2\) with \(b_1 \notin ST\wedge b_2<\omega\wedge\text{cof}(\text{lev}(a))=\omega\) then \(\text{lev}(s)=\text{lev}(a)[b_2]\)
 * 29) Otherwise, \(\text{lev}(s)=0\)