424
|
1 |
import M3._
|
390
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
assert(simp(ZERO | ONE) == ONE)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
assert(simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
assert(simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
assert(simp(((ONE ~ ONE) ~ ONE) ~ CHAR('a')) == CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
assert(simp(((ONE | ONE) ~ ONE) ~ CHAR('a')) == CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
9 |
assert(simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
assert(simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
11 |
assert(simp(CHAR('a') | CHAR('a')) == CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
12 |
assert(simp(CHAR('a') ~ CHAR('a')) == CHAR('a') ~ CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
assert(simp(ONE | CHAR('a')) == (ONE | CHAR('a')))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
14 |
assert(simp(ALT((CHAR('a') | ZERO) ~ ONE,
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
15 |
((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a'))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
16 |
assert(simp((ZERO | ((ZERO | ZERO) | (ZERO | ZERO))) ~ ((ONE | ZERO) | ONE ) ~ (CHAR('a'))) == ZERO)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
17 |
assert(simp(ALT(ONE | ONE, ONE | ONE)) == ONE)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
18 |
assert(simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a'))
|
424
|
19 |
assert(simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE, CHAR('a')))
|
463
|
20 |
assert(simp(ALTs(Nil)) == ZERO)
|
|
21 |
assert(simp(SEQs(List(CHAR('a')))) == CHAR('a'))
|
390
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
22 |
|