diff -r c08290ee4f1f -r 8664ff87cd77 progs/re3.scala --- a/progs/re3.scala Sun Oct 02 14:07:42 2016 +0100 +++ b/progs/re3.scala Sun Oct 02 15:07:21 2016 +0100 @@ -47,7 +47,7 @@ case (r1s, ONE) => r1s case (r1s, r2s) => SEQ(r1s, r2s) } - case NTIMES(r1, n) => NTIMES(simp(r), n) + case NTIMES(r1, n) => NTIMES(simp(r1), n) case r => r } @@ -78,16 +78,22 @@ (end - start)/(i * 1.0e9) } -val i = 5000 -println(i + " " + "%.5f".format(time_needed(10, matcher(EVIL1(i), "a" * i)))) + +//test: (a?{n}) (a{n}) +for (i <- 1 to 10001 by 1000) { + println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL1(i), "a" * i)))) +} -for (i <- 1 to 9001 by 1000) { +for (i <- 1 to 10001 by 1000) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL1(i), "a" * i)))) } +//test: (a*)* b +for (i <- 1 to 7500001 by 500000) { + println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL2, "a" * i)))) +} + for (i <- 1 to 7500001 by 500000) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL2, "a" * i)))) } - -