Exemple #1
0
        internal override Automaton <BDD> GetAutomatonBDD(SimpleList <Variable> variables, IBDDAlgebra alg, int nrOfLabelBits, bool singletonSetSemantics)
        {
            //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 + nrOfLabelBits;
            var             variablesExt = variables.Append(var);
            var             autPhi       = phi.GetAutomatonBDD(variablesExt, alg, nrOfLabelBits, singletonSetSemantics);
            Automaton <BDD> autEx;

            if (this.IsFirstOrder)
            {
                if (singletonSetSemantics)
                {
                    autEx = autPhi.Intersect(BasicAutomata.MkSingleton(varIndex, alg)).Minimize();
                }
                else
                {
                    autEx = autPhi.Intersect(BasicAutomata.MkIsNonempty(varIndex, alg)).Minimize();
                }
            }
            else
            {
                autEx = autPhi;
            }

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

            foreach (var move in autEx.GetMoves())
            {
                newMoves.Add(new Move <BDD>(move.SourceState, move.TargetState, alg.OmitBit(move.Label, varIndex)));
            }

            var aut = Automaton <BDD> .Create(alg, autEx.InitialState, autEx.GetFinalStates(), newMoves);

            var res = aut.Determinize();

            res = res.Minimize();

            return(res);
        }
Exemple #2
0
        internal override Automaton <BDD> GetAutomatonBDD(SimpleList <Variable> variables, IBDDAlgebra alg, int nrOfLabelBits)
        {
            //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 + nrOfLabelBits;
            var variablesExt = variables.Append(var);
            var autPhi       = phi.GetAutomatonBDD(variablesExt, alg, nrOfLabelBits);

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

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

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

            var res = aut.Determinize(alg);

            res = res.Minimize(alg);

            return(res);
        }