diff -r ae85207c6a93 -r 1255b4dbe516 progs/automata/enfa.sc --- a/progs/automata/enfa.sc Sun Oct 11 09:10:08 2020 +0100 +++ b/progs/automata/enfa.sc Tue Oct 13 14:29:10 2020 +0100 @@ -6,7 +6,7 @@ // a fixpoint construction import scala.annotation.tailrec @tailrec -def fixpT[A](f: A => A, x: A): A = { +def fixpT[S](f: S => S, x: S): S = { val fx = f(x) if (fx == x) x else fixpT(f, fx) } @@ -49,10 +49,11 @@ case (Q2, Some('b')) => Set(Q2) } -val enfa1 = eNFA(Set[State](Q0), enfa_trans1, Set[State](Q2)) +val nfa1 = + eNFA(Set[State](Q0), enfa_trans1, Set[State](Q2)) -// +// more examples case object R1 extends State case object R2 extends State case object R3 extends State @@ -64,4 +65,5 @@ } -val enfa2 = eNFA(Set[State](R1), enfa_trans1, Set[State](R3)) +val nfa2 = + eNFA(Set[State](R1), enfa_trans1, Set[State](R3))