main_testing3/re_test3.scala
changeset 403 ffce7b61b446
parent 347 4de31fdc0d67
child 433 6af86ba1208f
equal deleted inserted replaced
402:de59aa20a1dc 403:ffce7b61b446
     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