| changeset 242 | 3308eeb73d11 |
| parent 226 | 6bb7810d2108 |
| child 243 | 80102fba0a93 |
--- a/progs/lecture4.scala Fri Dec 07 08:54:34 2018 +0000 +++ b/progs/lecture4.scala Fri Dec 07 12:17:27 2018 +0000 @@ -308,6 +308,9 @@ def next(q: A, c: C) : Set[A] = Try(delta(q, c)) getOrElse Set[A]() + def nexts(qs: Set[A], c: C) : Set[A] = + qs.flatMap(next(_, c)) + // depth-first version of accepts def search(q: A, s: List[C]) : Boolean = s match { case Nil => fins(q)