--- a/scala/ex.scala Thu Feb 28 15:21:43 2013 +0000
+++ b/scala/ex.scala Fri Mar 01 02:56:08 2013 +0000
@@ -3,7 +3,7 @@
import abacus._
import recs._
import comp1._
-//import comp2._
+import comp2._
// Turing machine examples
val TMCopy = TM((WBk, 5), (R, 2), (R, 3), (R, 2), (WOc, 3),
@@ -81,10 +81,17 @@
println("NextPrime 3: " + NextPrime.eval(3))
println("NthPrime 1: " + NthPrime.eval(1))
println("Listsum [2, 3, 4 , 5, 6]: " + Listsum(5, 4).eval(2, 3, 4, 5, 6))
-// Ask Jian
println("Strt: " + Strt(2).eval(2, 3))
-val ABCZero = Abacus(Goto(1))
-val ABCSucc = Plus(0, 1, 2, 7) ++ Abacus(Inc(1)).shift(Plus(0, 1, 2, 7).p.length, -1)
-def ABCId(n: Int, m: Int) = Plus(m, n, n + 1, 7)
+
+
+println(Const(1))
+println(compile_rec(Const(1))._1)
+println(compile_rec(Const(1)))
+println(compile_rec(Const(1))._1.run(Map(0 -> 1, 1 -> 1, 2 -> 0)))
+println(Add)
+println(compile_rec(Add)._1)
+println(compile_rec(Add))
+println(compile_rec(Add)._1.run(Map(0 -> 3, 1 -> 8, 2 -> 0)))
+//compile_rec(Add)._1.run(Map(0 -> 3, 1 -> 4, 2 -> 0))