equal
deleted
inserted
replaced
50 case (r1s, r2s) => SEQ(r1s, r2s) |
50 case (r1s, r2s) => SEQ(r1s, r2s) |
51 } |
51 } |
52 case r => r |
52 case r => r |
53 } |
53 } |
54 |
54 |
|
55 //example |
|
56 val r = SEQ(SEQ(CHAR('x'), CHAR('y')), CHAR('z')) |
|
57 der('x', r) |
|
58 der('y', der('x', r)) |
|
59 der('z', der('y', der('x', r))) |
|
60 simp(der('z', der('y', der('x', r)))) |
|
61 |
55 // *new* |
62 // *new* |
56 // derivative w.r.t. a string (iterates der) |
63 // derivative w.r.t. a string (iterates der) |
57 def ders2(s: List[Char], r: Rexp) : Rexp = (s, r) match { |
64 def ders2(s: List[Char], r: Rexp) : Rexp = (s, r) match { |
58 case (Nil, r) => r |
65 case (Nil, r) => r |
59 case (s, ZERO) => ZERO |
66 case (s, ZERO) => ZERO |