progs/app6.scala
changeset 422 5deefcc8cffa
parent 412 1cef3924f7a2
child 435 e08431a78f66
equal deleted inserted replaced
417:e74c696821a2 422:5deefcc8cffa
     1 def simp(r: Rexp): Rexp = r match {
     1 def simp(r: Rexp) : Rexp = r match {
     2   case ALT(r1, r2) => {
     2   case ALT(r1, r2) => {
     3     (simp(r1), simp(r2)) match {
     3     (simp(r1), simp(r2)) match {
     4       case (ZERO, r2s) => r2s
     4       case (ZERO, r2s) => r2s
     5       case (r1s, ZERO) => r1s
     5       case (r1s, ZERO) => r1s
     6       case (r1s, r2s) => 
     6       case (r1s, r2s) =>