# HG changeset patch # User cu # Date 1508096834 -3600 # Node ID 955d5b3b06195c953e704fb6ad87bc70652d339e # Parent aecbe0077f2d7deecbeaa496ea6732d7ea59d043 updated diff -r aecbe0077f2d -r 955d5b3b0619 progs/re3.scala --- a/progs/re3.scala Wed Oct 11 14:33:13 2017 +0100 +++ b/progs/re3.scala Sun Oct 15 20:47:14 2017 +0100 @@ -74,7 +74,7 @@ // Test Cases //evil regular expressions -def EVIL1(n: Int) = SEQ(NTIMES(OPT(CHAR('a')), n), NTIMES(CHAR('a'), n)) +def EVIL1(n: Int) = SEQ(NTIMEemacs re3S(OPT(CHAR('a')), n), NTIMES(CHAR('a'), n)) val EVIL2 = SEQ(STAR(STAR(CHAR('a'))), CHAR('b')) @@ -87,11 +87,11 @@ //test: (a?{n}) (a{n}) -for (i <- 1 to 11001 by 1000) { +for (i <- 1 to 8001 by 1000) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL1(i), "a" * i)))) } -for (i <- 1 to 11001 by 1000) { +for (i <- 1 to 8001 by 1000) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL1(i), "a" * i)))) } diff -r aecbe0077f2d -r 955d5b3b0619 progs/re3a.scala --- a/progs/re3a.scala Wed Oct 11 14:33:13 2017 +0100 +++ b/progs/re3a.scala Sun Oct 15 20:47:14 2017 +0100 @@ -94,11 +94,11 @@ } //test: (a*)* b -for (i <- 1 to 5000001 by 500000) { +for (i <- 1 to 6000001 by 500000) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL2, "a" * i)))) } -for (i <- 1 to 5000001 by 500000) { +for (i <- 1 to 6000001 by 500000) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL2, "a" * i)))) } @@ -112,7 +112,9 @@ val r6 = simp(der('a', r5)) //test: (a|aa)* b +/* for (i <- 1 to 7001 by 500) { println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL3, "a" * i ++ "c")))) } + */