equal
deleted
inserted
replaced
1 import CW8c._ |
1 import M3._ |
2 |
2 |
3 |
3 |
4 assert(simp(ZERO | ONE) == ONE) |
4 assert(simp(ZERO | ONE) == ONE) |
5 assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)) |
5 assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)) |
6 assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')) |
6 assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')) |
14 assert(simp(ALT((CHAR('a') | ZERO) ~ ONE, |
14 assert(simp(ALT((CHAR('a') | ZERO) ~ ONE, |
15 ((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a')) |
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) |
16 assert(simp((ZERO | ((ZERO | ZERO) | (ZERO | ZERO))) ~ ((ONE | ZERO) | ONE ) ~ (CHAR('a'))) == ZERO) |
17 assert(simp(ALT(ONE | ONE, ONE | ONE)) == ONE) |
17 assert(simp(ALT(ONE | ONE, ONE | ONE)) == ONE) |
18 assert(simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a')) |
18 assert(simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a')) |
19 assert(simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE | CHAR('a'), CHAR('a') | ONE)) |
19 assert(simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE, CHAR('a'))) |
20 |
20 |
21 |
21 |