progs/re4.scala
changeset 546 6589afc6789b
parent 477 b78664a24f5d
child 550 71fc4a7a7039
--- a/progs/re4.scala	Mon Jan 01 15:02:03 2018 +0000
+++ b/progs/re4.scala	Thu Feb 01 21:06:20 2018 +0000
@@ -52,6 +52,13 @@
   case r => r
 }
 
+//example
+val r = SEQ(SEQ(CHAR('x'), CHAR('y')), CHAR('z'))
+der('x', r)
+der('y', der('x', r))
+der('z', der('y', der('x', r)))
+simp(der('z', der('y', der('x', r))))
+
 // *new*
 // derivative w.r.t. a string (iterates der)
 def ders2(s: List[Char], r: Rexp) : Rexp = (s, r) match {