Partial.scala
changeset 92 aaa2f2b52baf
parent 0 902326e1615a
equal deleted inserted replaced
91:4fd50a6844aa 92:aaa2f2b52baf
    89       }
    89       }
    90       case r => Set(r)
    90       case r => Set(r)
    91     }
    91     }
    92   }
    92   }
    93   def comp(s: List[Char], t: Rexp) = {
    93   def comp(s: List[Char], t: Rexp) = {
    94     //var r = internalise(t)
    94     var r = internalise(t)
    95     //var setr = Set(t)
    95     var setr = Set(t)
    96     
    96     
    97     /*for(i <- 0 to s.length - 1){
    97     for(i <- 0 to s.length - 1){
    98       val mamaipi = bsimp(bder(s(i), r))
    98       val mamaipi = bsimp(bder(s(i), r))
    99       val mamaimapi = pdps(List(s(i)), setr)
    99       val mamaimapi = pdps(List(s(i)), setr)
   100       //compare dersimp and pder w.r.t each character in string s
   100       //compare dersimp and pder w.r.t each character in string s
   101       println("current string: " + s.slice(0,i + 1))
   101       println("current string: " + s.slice(0,i + 1))
   102       println("der+simp: ")
   102       println("der+simp: ")
   103       println(aregx_tree(mamaipi))
   103       println(aregx_tree(mamaipi))
   104       println("pder: ")
   104       println("pder: ")
   105       mamaimapi.foreach(m => println(regx_tree(m)))
   105       mamaimapi.foreach(m => println(regx_tree(m)))
   106       r = mamaipi
   106       r = mamaipi
   107       setr = mamaimapi 
   107       setr = mamaimapi 
   108     }*/
   108     }
   109     for(i <- 1 to 10)
   109     for(i <- 1 to 10)
   110       println(pderas(Set(t), i).size, i)
   110       println(pderas(Set(t), i).size, i)
   111     //val alphabet_star_t = pderas(Set(t), 10)
   111     val alphabet_star_t = pderas(Set(t), 10)
   112     //println("all possible elements in pder (probably...): ")
   112     println("all possible elements in pder (probably...): ")
   113     //alphabet_star_t.foreach(r => println(regx_tree(r)))
   113     alphabet_star_t.foreach(r => println(regx_tree(r)))
   114   }
   114   }
   115 }
   115 }
   116 /*    val delta = lfs(t).map(mon => mon._2)                
   116 /*    val delta = lfs(t).map(mon => mon._2)                
   117     if(delta.size == t.size)
   117     if(delta.size == t.size)
   118     {
   118     {