Exemplo n.º 1
0
        /// <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());
        }
Exemplo n.º 2
0
        /// <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());
        }
Exemplo n.º 3
0
 internal void Determinize()
 {
     BasicOperations.Determinize(this);
 }