310 false |
310 false |
311 } |
311 } |
312 } |
312 } |
313 def size_comp(anatomy: List[Rexp], pd: Set[Rexp]):Boolean = {println("size of PD and bspilled simp regx: ", pd.size, anatomy.size); true} |
313 def size_comp(anatomy: List[Rexp], pd: Set[Rexp]):Boolean = {println("size of PD and bspilled simp regx: ", pd.size, anatomy.size); true} |
314 def size_expansion_rate(anatomy: List[Rexp], pd: Set[Rexp]): Boolean = if(anatomy.size > (pd.size)*2 ) {println("size of PD and bspilled simp regx: ", pd.size, anatomy.size); inclusion_truth(anatomy, pd); false }else {true} |
314 def size_expansion_rate(anatomy: List[Rexp], pd: Set[Rexp]): Boolean = if(anatomy.size > (pd.size)*2 ) {println("size of PD and bspilled simp regx: ", pd.size, anatomy.size); inclusion_truth(anatomy, pd); false }else {true} |
315 |
315 def ders_simp(r: ARexp, s: List[Char]): ARexp = { |
|
316 s match { |
|
317 case Nil => r |
|
318 case c::cs => ders_simp(bsimp(bder(c, r)), cs) |
|
319 } |
|
320 } |
316 def check_all(){ |
321 def check_all(){ |
317 for(i <- 1 to 1) |
322 for(i <- 1 to 1) |
318 { |
323 { |
319 val s = "bb"//rd_string_gen(alphabet_size, 5)//"ac"//rd_string_gen(alphabet_size, 5) |
324 val s = "bb"//rd_string_gen(alphabet_size, 5)//"ac"//rd_string_gen(alphabet_size, 5) |
320 val r = STAR(STAR(ALTS(List(SEQ(CHAR('b'),CHAR('b')), ALTS(List(CHAR('a'), CHAR('b')))))))//balanced_struct_gen(4)//SEQ(ALTS(List(STAR("a"),ALTS(List("a","c")))),SEQ(ALTS(List("c","a")),ALTS(List("c","b")))) //random_struct_gen(7) |
325 val r = STAR(STAR(ALTS(List(SEQ(CHAR('b'),CHAR('b')), ALTS(List(CHAR('a'), CHAR('b')))))))//balanced_struct_gen(4)//SEQ(ALTS(List(STAR("a"),ALTS(List("a","c")))),SEQ(ALTS(List("c","a")),ALTS(List("c","b")))) //random_struct_gen(7) |
321 //subset_check(r, s) |
326 //subset_check(r, s) |
322 weak_sub_check(r, s, 5, size_expansion_rate) |
327 weak_sub_check(r, s, 5, size_expansion_rate) |
323 } |
328 } |
324 } |
329 } |
|
330 def correctness_proof_convenient_path(){ |
|
331 for(i <- 1 to 1) |
|
332 { |
|
333 val s = "abaa"//rd_string_gen(alphabet_size, 3) |
|
334 val r = ASTAR(List(),AALTS(List(),List(ASTAR(List(Z),ACHAR(List(),'a')), ASEQ(List(S),ACHAR(List(),'a'),ACHAR(List(),'b')))))//internalise(balanced_struct_gen(3))//SEQ(ALTS(List(STAR("a"),ALTS(List("a","c")))),SEQ(ALTS(List("c","a")),ALTS(List("c","b")))) //random_struct_gen(7) |
|
335 for(j <- 0 to s.length - 1){ |
|
336 val ss = s.slice(0, j+ 1) |
|
337 val nangao = ders_simp(r, ss.toList) |
|
338 val easy = bsimp(bders(ss.toList, r)) |
|
339 if(nangao != easy|| j == 2){ |
|
340 println(j) |
|
341 if(j == 3) println("not equal") |
|
342 println(ss) |
|
343 println(r) |
|
344 println(nangao) |
|
345 println(easy) |
|
346 } |
|
347 } |
|
348 } |
|
349 } |
325 def main(args: Array[String]) { |
350 def main(args: Array[String]) { |
326 check_all() |
351 //check_all() |
|
352 correctness_proof_convenient_path |
327 } |
353 } |
328 } |
354 } |
329 |
355 |