public IMonadicPredicate <T, S> GetAtom(IMonadicPredicate <T, S> psi) { if (!IsAtomic) { throw new AutomataException(AutomataExceptionKind.BooleanAlgebraIsNotAtomic); } foreach (var tuple in psi.GetSumOfProducts()) { var a2 = nodeAlgebra.GetAtom(tuple.Item2); var a1 = leafAlgebra.GetAtom(tuple.Item1); var a = MkNode(a1, a2); return(a); } return(_False); }
public Pair <S, T> GetAtom(Pair <S, T> psi) { if (!IsAtomic) { throw new AutomataException(AutomataExceptionKind.BooleanAlgebraIsNotAtomic); } var a1 = first.GetAtom(psi.Item1); if (a1.Equals(first.False)) { return(False); } var a2 = second.GetAtom(psi.Item2); if (a2.Equals(second.False)) { return(False); } return(new Pair <S, T>(a1, a2)); }
/// <summary> /// Gets the atom of a predicate. /// </summary> 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); }