random test failed
authorChengsong
Sat, 16 Mar 2019 15:00:43 +0000
changeset 6 26b40a985622
parent 5 622ddbb1223a
child 7 1572760ff866
random test failed on the new simplification function. ("super_blexing_simp")
Spiral.scala
--- a/Spiral.scala	Sat Mar 16 14:14:42 2019 +0000
+++ b/Spiral.scala	Sat Mar 16 15:00:43 2019 +0000
@@ -214,6 +214,16 @@
       case (2, i) => ALTS( List(random_struct_gen(depth - 1), random_struct_gen(depth - 1) ) )
     }
   }
+  def random_pool(n: Int, d: Int) : Stream[Rexp] = n match {
+    case 0 => (for (i <- 1 to 10) yield balanced_struct_gen(d)).toStream
+    case n => {  
+      val rs = random_pool(n - 1, d)
+      rs #:::
+      (for (i <- (1 to 10).toStream) yield balanced_struct_gen(d)) #::: 
+      (for (i <- (1 to 10).toStream) yield random_struct_gen(d))
+    }
+  }
+
   def rd_string_gen(alp_size: Int, len: Int): String = {
     if( len > 0)
       ((ran.nextInt(alp_size) + 97).toChar).toString + rd_string_gen(alp_size, len - 1)
@@ -388,7 +398,9 @@
   }
   def main(args: Array[String]) {
     //check_all()   
-    enum(3, "abc").map(tests_blexer_simp(strs(3, "abc"))).toSet
+    //enum(3, "abc").map(tests_blexer_simp(strs(3, "abc"))).toSet
+    //
+    random_pool(1, 5).map(tests_blexer_simp(strs(5, "abc"))).toSet
     //correctness_proof_convenient_path()
   } 
 }