main_solution3/re.scala
changeset 418 fa7f7144f2bb
parent 400 e48ea8300b2d
child 424 daf561a83ba6
equal deleted inserted replaced
417:29fc780ca130 418:fa7f7144f2bb
   106     case (r1s, r2s) => SEQ(r1s, r2s)
   106     case (r1s, r2s) => SEQ(r1s, r2s)
   107   }
   107   }
   108   case r => r
   108   case r => r
   109 }
   109 }
   110 
   110 
       
   111 simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE))
   111 
   112 
   112 // (4) Complete the two functions below; the first 
   113 // (4) Complete the two functions below; the first 
   113 // calculates the derivative w.r.t. a string; the second
   114 // calculates the derivative w.r.t. a string; the second
   114 // is the regular expression matcher taking a regular
   115 // is the regular expression matcher taking a regular
   115 // expression and a string and checks whether the
   116 // expression and a string and checks whether the