changeset 10 | 2b95bcd2ac73 |
parent 8 | e67c0ea1ca73 |
child 11 | 9c1ca6d6e190 |
9:2c02d27ec0a3 | 10:2b95bcd2ac73 |
---|---|
431 |
431 |
432 weak_sub_check(big_panda, str_panda, 6, size_expansion_rate) |
432 weak_sub_check(big_panda, str_panda, 6, size_expansion_rate) |
433 |
433 |
434 } |
434 } |
435 //simplified regex size 291, so called pd_simp size 70 (did not do simplification to terms in the PD set) |
435 //simplified regex size 291, so called pd_simp size 70 (did not do simplification to terms in the PD set) |
436 |
436 def pushbits(r: ARexp): ARexp = r match { |
437 case AALTS(bs, rs) => AALTS(Nil, rs.map(fuse(bs, _))) |
|
438 case r => r |
|
439 } |
|
437 def correctness_proof_convenient_path(){ |
440 def correctness_proof_convenient_path(){ |
438 for(i <- 1 to 1) |
441 for(i <- 1 to 1) |
439 { |
442 { |
440 val s = "abaa"//rd_string_gen(alphabet_size, 3) |
443 val s = "baa"//rd_string_gen(alphabet_size, 3)//"abaa"//rd_string_gen(alphabet_size, 3) |
441 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) |
444 val r = ASTAR(List(),ASEQ(List(),AALTS(List(),List(ACHAR(List(Z),'c'), ACHAR(List(S),'b'))),ASEQ(List(),ASTAR(List(),ACHAR(List(),'a')),AALTS(List(),List(ACHAR(List(Z),'a'), ACHAR(List(S),'a'))))))//internalise(random_struct_gen(4))//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) |
442 for(j <- 0 to s.length - 1){ |
445 for(j <- 0 to s.length - 1){ |
443 val ss = s.slice(0, j+ 1) |
446 val ss = s.slice(0, j+ 1) |
444 val nangao = ders_simp(r, ss.toList) |
447 val nangao = ders_simp(r, ss.toList) |
445 val easy = bsimp(bders(ss.toList, r)) |
448 val easy = bsimp(bders(ss.toList, r)) |
446 if(true){ |
449 if(!(nangao == easy || pushbits(nangao) == (easy))){ |
447 println(j) |
450 println(j) |
448 if(j == 3) println("not equal") |
451 println("not equal") |
449 println("string") |
452 println("string") |
450 println(ss) |
453 println(ss) |
451 println("original regex") |
454 println("original regex") |
452 println(r) |
455 println(annotated_tree(r)) |
453 println("regex after ders simp") |
456 println("regex after ders simp") |
454 println(nangao) |
457 println(annotated_tree(nangao)) |
455 println("regex after ders") |
458 println("regex after ders") |
456 println(annotated_tree(bders(ss.toList, r)))//flats' fuse when opening up AALTS causes the difference |
459 println(annotated_tree(bders(ss.toList, r)))//flats' fuse when opening up AALTS causes the difference |
457 println("regex after ders and then a single simp") |
460 println("regex after ders and then a single simp") |
458 println(annotated_tree(easy)) |
461 println(annotated_tree(easy)) |
459 } |
462 } |