progs/re4.scala
changeset 467 b5ec11e89768
parent 455 1dbf84ade62c
child 477 b78664a24f5d
--- a/progs/re4.scala	Mon Oct 24 14:46:47 2016 +0100
+++ b/progs/re4.scala	Sat Oct 29 21:45:44 2016 +0100
@@ -57,7 +57,7 @@
   case (s, ONE) => if (s == Nil) ONE else ZERO
   case (s, CHAR(c)) => if (s == List(c)) ONE else 
                        if (s == Nil) CHAR(c) else ZERO
-  case (s, ALT(r1, r2)) => ALT(ders2(s, r2), ders2(s, r2))
+  case (s, ALT(r1, r2)) => ALT(ders2(s, r1), ders2(s, r2))
   case (c::s, r) => ders2(s, simp(der(c, r)))
 }