Closed Lamericio closed 7 years ago
The problem was in concat(Automaton first, Automaton second)
when you add the initial state of the first automaton:
mappingFirst.put(firstInitialStates, new State("q" + c++, true, false)); newStates.add(firstInitialStates);
You have to add the map associated to firstInitialState
, not firstInitalState
. The right code is
mappingFirst.put(firstInitialStates, new State("q" + c++, true, false)); newStates.add(mappingFirst.get(firstInitialStates));
I'm going to commit the fix and then I will close the issue.
While i was testing #9 , I noticed that the library crashed on reverse() method call. Both my concat() methods, operating respectively on a collection and on two input automatas, returned the correct object, but when I tried to equal() the result, I got a NullPointerException on reverse() method.