private void ReduceStates() { var newState = 'A'; for (int i = 0; i < States.Count; i++) { if (StartState == States[i]) { StartState = newState.ToString(); } if (FinalStates.Contains(States[i])) { FinalStates[FinalStates.IndexOf(States[i])] = newState.ToString(); } foreach (var tr in Transitions) { if (tr.CurrentState == States[i]) { tr.CurrentState = newState.ToString(); } if (tr.NextState == States[i]) { tr.NextState = newState.ToString(); } } States[i] = newState.ToString(); newState++; } }