@override bool evaluate(String input) { if (!hasValidInput(input)) return false; final state = extendedTransition(initialState, input); return finalStates.contains(state); }