public bool isHavingCorrectTransitions() { int counter = 0; int expectedResult = Alphabets.Count() * States.Count(); // check if all the states has all the alphabets with the correct transitions foreach (var t in Transitions) { foreach (var s in States) { if (t.CurrentState.Name == s.Name) { foreach (var a in Alphabets) { if (t.Token == a) { counter++; } } } } } if (counter != expectedResult) { return(false); } return(true); }