const ZERO = (p)=>(x)=>x;
const ONE = (p)=>(x)=>p(x);
const TWO = (p)=>(x)=>p(p(x));
const THREE = (p)=>(x)=>p(p(p(x)));
const FIVE = (p)=>(x)=>p(p(p(p(p(x)))));

const INCREMENT = (n)=>((p)=>(x)=>p(n(p)(x)));
const ADD = (n)=>(m)=>(n(INCREMENT)(m));
const MULTIPLY = (n)=>(m)=>(n(ADD(m))(ZERO));
const POWER = (n)=>(m)=>(m(MULTIPLY(n))(ONE));

const DECREMENT = (n)=>(p)=>(x)=>n((g)=>(h)=>h(g(p)))((y)=>x)((y)=>y);
const SUBTRACT = (n)=>(m)=>(m(DECREMENT)(n));

// const DECREMENT = function (n) {
//     return function(p){
//         return function(x){
//             return n(function(g){
//                 return function(h) {
//                     return h(g(p))
//                 }
//             })(function(y){
//                 return x;
//             })(function(y){
//                 return y;
//             })
//         }
//     }
// }


function to_integer(n) {
    return n((x)=>x+1)(0)
}

console.log("  ++0 \t==\t "+to_integer(INCREMENT(ZERO)));
console.log("  ++1 \t==\t "+to_integer(INCREMENT(ONE)));
console.log("  ++2 \t==\t "+to_integer(INCREMENT(TWO)));
console.log("  ++3 \t==\t "+to_integer(INCREMENT(THREE)));

console.log("  0+3 \t==\t "+to_integer(ADD(ZERO)(THREE)));
console.log("  1+2 \t==\t "+to_integer(ADD(ONE)(TWO)));
console.log("  2*3 \t==\t "+to_integer(MULTIPLY(TWO)(THREE)));
console.log("  3^2 \t==\t "+to_integer(POWER(THREE)(TWO)));

console.log("  --0 \t==\t "+to_integer(DECREMENT(ZERO))+" *");
console.log("  --1 \t==\t "+to_integer(DECREMENT(ONE)));
console.log("  --2 \t==\t "+to_integer(DECREMENT(TWO)));
console.log("  --3 \t==\t "+to_integer(DECREMENT(THREE)));

console.log("  5-3 \t==\t "+to_integer(SUBTRACT(FIVE)(THREE)));
console.log("  3-5 \t==\t "+to_integer(SUBTRACT(THREE)(FIVE))+" *");

console.log("\n* decrement(0) = 0;");


@@ -460,1336 +460,461 @@
 );%0A%0A
-// 
 const 
-DECREMENT = function (n) %7B%0A//     return function(p)%7B%0A//         return function(x)%7B%0A//             return n(function(g)%7B%0A//                 return function(h) %7B%0A//                     return h(g(p))%0A//                 %7D%0A//             %7D)(function(y)%7B%0A//                 return x;%0A//             %7D)(function(y)%7B%0A//                 return y;%0A//             %7D)%0A//         %7D%0A//     %7D%0A// %7D%0A%0A%0Afunction to_integer(n) %7B%0A    return n((x)=%3Ex+1)(0)%0A%7D%0A%0Aconsole.log(%22  ++0 %5Ct==%5Ct %22+to_integer(INCREMENT(ZERO)));%0Aconsole.log(%22  ++1 %5Ct==%5Ct %22+to_integer(INCREMENT(ONE)));%0Aconsole.log(%22  ++2 %5Ct==%5Ct %22+to_integer(INCREMENT(TWO)));%0Aconsole.log(%22  ++3 %5Ct==%5Ct %22+to_integer(INCREMENT(THREE)));%0A%0Aconsole.log(%22  0+3 %5Ct==%5Ct %22+to_integer(ADD(ZERO)(THREE)));%0Aconsole.log(%22  1+2 %5Ct==%5Ct %22+to_integer(ADD(ONE)(TWO)));%0Aconsole.log(%22  2*3 %5Ct==%5Ct %22+to_integer(MULTIPLY(TWO)(THREE)));%0Aconsole.log(%22  3%5E2 %5Ct==%5Ct %22+to_integer(POWER(THREE)(TWO)));%0A%0Aconsole.log(%22  --0 %5Ct==%5Ct %22+to_integer(DECREMENT(ZERO))+%22 *%22);%0Aconsole.log(%22  --1 %5Ct==%5Ct %22+to_integer(DECREMENT(ONE)));%0Aconsole.log(%22  --2 %5Ct==%5Ct %22+to_integer(DECREMENT(TWO)));%0Aconsole.log(%22  --3 %5Ct==%5Ct %22+to_integer(DECREMENT(THREE)));%0A%0Aconsole.log(%22  5-3 %5Ct==%5Ct %22+to_integer(SUBTRACT(FIVE)(THREE)));%0Aconsole.log(%22  3-5 %5Ct==%5Ct %22+to_integer(SUBTRACT(THREE)(FIVE))+%22 *%22);%0A%0Aconsole.log(%22%5Cn* decrement(0) = 0;%22);%0A%0A
+TRUE = (x)=%3E(y)=%3Ex;%0Aconst FALSE = (x)=%3E(y)=%3Ey;%0Aconst IF = (b)=%3Eb;%0A%0Aconst AND = (a)=%3E(b)=%3Ea(b)(a);%0Aconst OR = (a)=%3E(b)=%3Ea(a)(b);%0Aconst NOT = (c)=%3E(a)=%3E(b)=%3Ec(b)(a); //Applicative Order%0A// const NOT = (p)=%3Ep(FALSE)(TRUE);    //Normal Order%0Aconst XOR = (a)=%3E(b)=%3Ea(NOT(b))(b);%0A%0Afunction to_boolean(b) %7B%0A    return b(true)(false)%0A%7D%0A%0Afunction to_integer(n) %7B%0A    return n((x)=%3Ex+1)(0)%0A%7D%0A%0A%0Aconsole.log(to_boolean(NOT(TRUE)));%0Aconsole.log(to_boolean(FALSE));

implement BOOLEAN