/// <summary> /// Minimizes the given automaton using Brzozowski's algorithm. /// </summary> /// <param name="a">The automaton.</param> internal static void MinimizeBrzozowski(Automaton a) { if (a.IsSingleton) { return; } BasicOperations.Determinize(a, SpecialOperations.Reverse(a).ToList()); BasicOperations.Determinize(a, SpecialOperations.Reverse(a).ToList()); }
/// <summary> /// Determinizes the specified automaton. /// </summary> /// <remarks> /// Complexity: exponential in number of states. /// </remarks> /// <param name="a">The automaton.</param> internal static void Determinize(Automaton a) { if (a.IsDeterministic || a.IsSingleton) { return; } var initialset = new HashSet <State>(); initialset.Add(a.Initial); BasicOperations.Determinize(a, initialset.ToList()); }
internal void Determinize() { BasicOperations.Determinize(this); }