author | Christian Urban <christian.urban@kcl.ac.uk> |
Thu, 02 Nov 2023 23:34:53 +0000 | |
changeset 475 | 59e005dcf163 |
parent 433 | 6af86ba1208f |
permissions | -rw-r--r-- |
475 | 1 |
|
2 |
def urbanmain() = { |
|
300 | 3 |
|
475 | 4 |
import M3._ |
5 |
||
6 |
val EVIL_urban = SEQ(STAR(STAR(CHAR('a'))), CHAR('b')) |
|
300 | 7 |
|
8 |
||
475 | 9 |
assert(simp(Iterator.iterate(ONE:Rexp)(r => SEQ(r, ONE | ONE)).drop(50).next) == ONE) |
10 |
assert(simp(Iterator.iterate(ONE:Rexp)(r => ALT(r, r)).drop(20).next) == ONE) |
|
11 |
assert(matcher(EVIL_urban, "a" * 1000000) == false) |
|
12 |
assert(matcher(EVIL_urban, "a" * 1000000 ++ "b") == true) |
|
13 |
} |