User blog:Ubersketch/CNF comparison algorithm

a<b algorithm

1. Suppose b has notation 0. a<b is not satisfied, else go to 2.

2. Suppose a has notation 0 and b has notation w^(c_0)+w^(c_1)+w^(c_2)...w^(c_k). a<b is satisfied, else go to 3.

3. Suppose a has notation w^(c_0)+w^(c_1)+w^(c_2)...w^(c_k) and b has notation w^(d_0)+w^(d_1)+w^(d_2)...w^(d_l). Set state to S0 and go to 4.

4. Suppose current state is Sn. Check if c_n<d_n. If c_n<d_n, a<b, else set state to Sn+1 and go to 3 unless n=k, in which case a<b is not satisfied, else, a<b is satisfied.

Example:

w^0+w^0<w^0+w^0+w^0

S0 0<0 is false as a<0 is not satisfied for any a

S1 0<0 is false a<0 is not satisfied for any a

S2 2=k.

w^0+w^0<w^0+w^0+w^0 is satisfied

w^2+w^2<w^2+w^1

S0 2<2 is not satisfied.

S1 2<1 is not satisfied.

w^2+w^2<w^2+w^1 is not satisfied.

w^0+w^0+w^0<w^0+w^0

S0 0<0 is not satisfied.

S1 0<0 is not satisfied.

S3 3=k

w^0+w^0+w^0<w^0+w^0 is not satisfied.