168
|
1 |
|
|
2 |
|
|
3 |
|
|
4 |
assert(simp(ZERO | ONE) == ONE)
|
|
5 |
assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE))
|
|
6 |
assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a'))
|
245
|
7 |
assert(simp(((ONE ~ ONE) ~ ONE) ~ CHAR('a')) == CHAR('a'))
|
|
8 |
assert(simp(((ONE | ONE) ~ ONE) ~ CHAR('a')) == CHAR('a'))
|
168
|
9 |
assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO)
|
|
10 |
assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a'))
|
|
11 |
assert(simp(CHAR('a') | CHAR('a')) == CHAR('a'))
|
|
12 |
assert(simp(CHAR('a') ~ CHAR('a')) == CHAR('a') ~ CHAR('a'))
|
|
13 |
assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a')))
|
|
14 |
assert(simp(ALT((CHAR('a') | ZERO) ~ ONE,
|
|
15 |
((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a'))
|
|
16 |
assert(simp((ZERO | ((ZERO | ZERO) | (ZERO | ZERO))) ~ ((ONE | ZERO) | ONE ) ~ (CHAR('a'))) == ZERO)
|
|
17 |
assert(simp(ALT(ONE | ONE, ONE | ONE)) == ONE)
|
|
18 |
assert(simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a'))
|
245
|
19 |
assert(simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE | CHAR('a'), CHAR('a') | ONE))
|
168
|
20 |
|
245
|
21 |
|