Example #1
0
        public Automaton <S> GetAtom(Automaton <S> psi)
        {
            if (!IsAtomic)
            {
                throw new AutomataException(AutomataExceptionKind.BooleanAlgebraIsNotAtomic);
            }

            if (psi.IsEmpty)
            {
                return(psi);
            }

            var path  = new List <S>(psi.ChoosePathToSomeFinalState(new Chooser()));
            var moves = new List <Move <S> >();

            for (int i = 0; i < path.Count; i++)
            {
                moves.Add(Move <S> .Create(i, i + 1, solver.GetAtom(path[i])));
            }

            var atom = Automaton <S> .Create(solver, 0, new int[] { path.Count }, moves);

            return(atom);
        }