Пример #1
0
        internal override Automaton <IMonadicPredicate <BDD, T> > getAutomaton(SimpleList <Variable> variables, ICartesianAlgebraBDD <T> ca)
        {
            var aut1 = phi1.getAutomaton(variables, ca);
            var aut2 = phi2.getAutomaton(variables, ca);
            var aut3 = aut1.Intersect(aut2, ca);
            var aut  = aut3.Minimize(ca);

            //var aut_old = aut.Determinize(ca).Minimize(ca);
            return(aut);
        }
Пример #2
0
        internal override Automaton <IMonadicPredicate <BDD, T> > getAutomaton(SimpleList <Variable> variables, ICartesianAlgebraBDD <T> alg)
        {
            var aut1 = phi1.getAutomaton(variables, alg);
            var aut2 = phi2.getAutomaton(variables, alg);
            //var res = aut1.Complement(alg).Intersect(aut2.Complement(alg), alg).Complement(alg);
            //res = res.Determinize(alg).Minimize(alg);
            var res  = aut1.Union(aut2).RemoveEpsilons(alg.MkOr);
            var res1 = res.Minimize(alg);

            return(res1);
        }
Пример #3
0
        internal override Automaton <BDD> getAutomaton(SimpleList <string> variables, CharSetSolver solver)
        {
            var moves = new Move <BDD>[] { new Move <BDD>(0, 0, solver.True) };

            //True automaton and then difference
            var trueAut = Automaton <BDD> .Create(solver, 0, new int[] { 0 }, moves);

            var aut     = phi.getAutomaton(variables, solver);
            var neg_aut = trueAut.Minus(aut, solver).Determinize(solver).Minimize(solver);

            return(neg_aut);
        }
Пример #4
0
        internal override Automaton <BDD> getAutomaton(SimpleList <string> variables, CharSetSolver solver)
        {
            var aut1 = phi1.getAutomaton(variables, solver);
            var aut2 = phi2.getAutomaton(variables, solver);
            var res  = aut1.Intersect(aut2, solver);

            if (MINIMIZE)
            {
                res = res.Determinize(solver).Minimize(solver);
            }
            return(res);
        }
Пример #5
0
        internal override Automaton <IMonadicPredicate <BDD, T> > getAutomaton(SimpleList <Variable> variables, ICartesianAlgebraBDD <T> alg)
        {
            var aut = phi.getAutomaton(variables, alg);
            var res = aut.Determinize(alg).Complement(alg).Minimize(alg);

            foreach (var x in phi.GetFreeVariables(true))
            {
                var sing = new WS1SSingleton <T>(x).getAutomaton(variables, alg);
                res = res.Intersect(sing, alg).Determinize(alg).Minimize(alg);
            }
            return(res);
        }
Пример #6
0
        internal override Automaton <BDD> getAutomaton(SimpleList <string> variables, CharSetSolver solver)
        {
            var aut1 = phi1.getAutomaton(variables, solver);
            var aut2 = phi2.getAutomaton(variables, solver);
            //var res = aut1.Union(aut2, solver).RemoveEpsilons(solver.MkOr);
            var res = aut1.Complement(solver).Intersect(aut2.Complement(solver), solver).Complement(solver);

            if (MINIMIZE)
            {
                res = res.Determinize(solver).Minimize(solver);
            }
            return(res);
        }
Пример #7
0
        internal override Automaton <BDD> getAutomaton(SimpleList <string> variables, CharSetSolver solver)
        {
            //Automaton<BvSet> for formula
            var varCopy = variables.Append(X);
            var autPhi  = phi.getAutomaton(varCopy, solver);

            var newMoves = new List <Move <BDD> >();
            var k        = variables.Count + ((int)solver.Encoding);

            foreach (var move in autPhi.GetMoves())
            {
                var newCond = solver.OmitBit(move.Label, k);
                newMoves.Add(new Move <BDD>(move.SourceState, move.TargetState, newCond));
            }

            var res = Automaton <BDD> .Create(solver, autPhi.InitialState, autPhi.GetFinalStates(), newMoves);

            if (MINIMIZE)
            {
                res = res.Determinize(solver).Minimize(solver);
            }
            return(res);
        }
Пример #8
0
        internal override Automaton <IMonadicPredicate <BDD, T> > getAutomaton(SimpleList <Variable> variables, ICartesianAlgebraBDD <T> alg)
        {
            //the existential variable will shadow any previous occurrence with the same name
            //because when looking up the index of var it will be the last occurrence
            var varIndex     = variables.Count;
            var variablesExt = variables.Append(var);
            var autPhi       = phi.getAutomaton(variablesExt, alg);

            //Project away the the existential variable
            var newMoves = new List <Move <IMonadicPredicate <BDD, T> > >();

            foreach (var move in autPhi.GetMoves())
            {
                var newPred = alg.Omit(varIndex, move.Label);
                newMoves.Add(new Move <IMonadicPredicate <BDD, T> >(move.SourceState, move.TargetState, newPred));
            }

            var res = Automaton <IMonadicPredicate <BDD, T> > .Create(alg, autPhi.InitialState, autPhi.GetFinalStates(), newMoves);

            //var res = res.Determinize(alg);
            var res_min = res.Minimize(alg);

            return(res_min);
        }