Spiral.scala
changeset 92 aaa2f2b52baf
parent 91 4fd50a6844aa
child 93 d486c12deeab
--- a/Spiral.scala	Mon Nov 11 17:37:24 2019 +0000
+++ b/Spiral.scala	Wed Nov 27 14:15:00 2019 +0000
@@ -648,6 +648,7 @@
     case c::cs => if(bnullable(c)) re_close(cs, l2.tail, AALTS(List(), List(re_init, fuse(mkepsBC(c), l2.head)) ) ) 
     else re_close(cs, l2.tail, re_init)
   }
+  //HERE
   def closed_string_der(r1: ARexp, r2: ARexp, s: String): ARexp = {
     val l1 = der_seq(r1, s.toList, Nil)
     val l2 = der_seq_rev(r2, s.toList, Nil)
@@ -670,8 +671,26 @@
     //closed_string_der(r1, r2, s2)
     closed_string_der(r1, r2, s3)
   }
+
+  def string_der_test(){
+    for(i <- 0 to 10){
+      val s = rd_string_gen(alphabet_size, i).toList
+      val r = random_struct_gen(2)
+      if(ders(s, r) != ders2(s, r)){
+        println(i)
+        println(s)
+        println(r)
+        println(ders(s, r))
+        println(ders2(s,r))
+        println("neq")
+      }
+    }
+  }
+
   def main(args: Array[String]) {
-    newxp1()
+    string_der_test()
+    //comp(rd_string_gen(3,6).toList, random_struct_gen(7))
+    //newxp1()
   //contains7()
   //retrieve_encode_STARS()
     //check_all()