{def xor {lambda {:a :b} {or {and :a {not :b}} {and :b {not :a}}}}} -> xor {def halfAdder {lambda {:a :b} {cons {and :a :b} {xor :a :b}}}} -> halfAdder {def fullAdder {lambda {:a :b :c} {let { {:b :b} {:ha1 {halfAdder :c :a}} } {let { {:ha1 :ha1} {:ha2 {halfAdder {cdr :ha1} :b}} } {cons {or {car :ha1} {car :ha2}} {cdr :ha2}} }}}} -> fullAdder {def 4bitsAdder {lambda {:a4 :a3 :a2 :a1 :b4 :b3 :b2 :b1} {let { {:a4 :a4} {:a3 :a3} {:a2 :a2} {:b4 :b4} {:b3 :b3} {:b2 :b2} {:fa1 {fullAdder :a1 :b1 false}} } {let { {:a4 :a4} {:a3 :a3} {:b4 :b4} {:b3 :b3} {:fa1 :fa1} {:fa2 {fullAdder :a2 :b2 {car :fa1}}} } {let { {:a4 :a4} {:b4 :b4} {:fa1 :fa1} {:fa2 :fa2} {:fa3 {fullAdder :a3 :b3 {car :fa2}}} } {let { {:fa1 :fa1} {:fa2 :fa2} {:fa3 :fa3} {:fa4 {fullAdder :a4 :b4 {car :fa3}}} } {car :fa4} {cdr :fa4} {cdr :fa3} {cdr :fa2} {cdr :fa1}}}}}}} -> 4bitsAdder {def bin2bool {lambda {:b} {if {W.empty? {W.rest :b}} then {= {W.first :b} 1} else {= {W.first :b} 1} {bin2bool {W.rest :b}}}}} -> bin2bool {def bool2bin {lambda {:b} {if {S.empty? {S.rest :b}} then {if {S.first :b} then 1 else 0} else {if {S.first :b} then 1 else 0}{bool2bin {S.rest :b}}}}} -> bool2bin {def bin2dec {def bin2dec.r {lambda {:p :r} {if {A.empty? :p} then :r else {bin2dec.r {A.rest :p} {+ {A.first :p} {* 2 :r}}}}}} {lambda {:p} {bin2dec.r {A.split :p} 0}}} -> bin2dec {def add {def numbers 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111} {lambda {:a :b} {bin2dec {bool2bin {4bitsAdder {bin2bool {S.get :a {numbers}}} {bin2bool {S.get :b {numbers}}}}}}}} -> add {table {S.map {lambda {:i} {tr {S.map {{lambda {:i :j} {td {add :i :j}}} :i} {S.serie 0 15}}}} {S.serie 0 15}} } -> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30