Spiral.scala
changeset 148 c8ef391dd6f7
parent 123 fb7472a29058
child 149 6c5920fd02a7
equal deleted inserted replaced
147:dfcf3fa58d7f 148:c8ef391dd6f7
   856     println(res)
   856     println(res)
   857     println(result)
   857     println(result)
   858     println(bsimp(bders( "a".toList, internalise(reg))))
   858     println(bsimp(bders( "a".toList, internalise(reg))))
   859     println(result1)
   859     println(result1)
   860   }
   860   }
       
   861   def finj_test0(c: Char, r: ARexp){
       
   862     val dr = bsimp(bder(c, r))
       
   863     val v = if(bnullable(dr)) mkeps(erase(dr)) else mkchr(erase(dr))
       
   864     val v0 = if(bnullable(dr)) mkeps(erase(bder(c,r))) else mkchr(erase(bder(c, r)))
       
   865     val v1 = inj(erase(r), c, v0)
       
   866     val v2 = fuzzy_inj(r, c, v)
       
   867     println(v1)
       
   868     println(v2)
       
   869     
       
   870   }
   861   def main(args: Array[String]) {
   871   def main(args: Array[String]) {
   862     //println(S.toString)
   872     //finj_test0('b', fuse(List(S, Z), internalise(  ( ("a"|"b")% ) )   ))
   863     //find_re()
   873     //finj_test0('a', fuse(List(S, Z), internalise(  ( ("a"|"b")% ) )   ))
   864     //tellmewhy()
   874     //finj_test0('b', bder('a', internalise(   (("c" | "ab")%)  )))
   865     //correctness_proof_convenient_path()
   875     //finj_test0('a', internalise(   (("c" | "ab")%)  ))
   866     tellmewhy()
   876     //this example gives us an exception
   867     //have_fun()
   877     val r = internalise(ALTS(List(STAR(CHAR('c')), STAR(CHAR('b')))))
   868     //string_der_test()
   878     val c = 'c'
   869     //comp(rd_string_gen(3,6).toList, random_struct_gen(7))
   879     //println(bits_print(r))
   870     //newxp1()
   880     //println(c)
   871   //contains7()
   881     //finj_test0(c, r)
   872   //retrieve_encode_STARS()
   882     for(i <- 1 to 1000){
   873     //check_all()   
   883       val r = random_struct_gen(3)//[{  a}*~{{a}*}*]
   874     //radical_correctness()
   884       val c = (ran.nextInt(3) + 97).toChar//Sequ(Stars(List()),Stars(List()))
   875     //correctness_proof_convenient_path()
   885       val dr = der(c, r)
   876     //retrieve_experience()
   886       val bdr = bder(c, internalise(r))
   877     //neat_retrieve()
   887       if(nullable(dr)){
   878     //test_bsimp2()
   888         println("bohooooooooooooooooo!")
   879     //christian_def2()
   889         val dv = mkeps(dr)
   880     //christian_def()
   890         val target_vr = bsimp2(bdr, dv)
   881     //essence_posix()
   891         println(bits_print(target_vr._1))
   882     //speed_test()
   892         println(target_vr._2)
   883   } 
   893         println(vunsimp(bdr, dv)(target_vr._2))
       
   894       }
       
   895     }
       
   896     
       
   897   }
       
   898    
   884 }
   899 }
   885 //List(              ASTAR(List(Z),ACHAR(List(),a)),            AALTS(List(S),List(ACHAR(List(Z),b), ACHAR(List(S),a)))       )
   900 //List(              ASTAR(List(Z),ACHAR(List(),a)),            AALTS(List(S),List(ACHAR(List(Z),b), ACHAR(List(S),a)))       )