Exemplo n.º 1
0
        /// <summary>
        /// all1 x: x in X_i => [psi](x)
        /// </summary>
        public static Automaton <BDD> MkLabelOfSet(int i, BDD psi, IBDDAlgebra alg)
        {
            var bit_i_is0 = alg.MkBitFalse(i);
            var cond      = alg.MkOr(psi, bit_i_is0);
            var moves     = new Move <BDD>[] { new Move <BDD>(0, 0, cond) };
            var aut       = Automaton <BDD> .Create(alg, 0, new int[] { 0 }, moves, false, false, true);

            return(aut);
        }
Exemplo n.º 2
0
        /// <summary>
        /// X_i sub X_j
        /// </summary>
        public static Automaton <BDD> MkSubset(int i, int j, IBDDAlgebra alg)
        {
            var bit_j_is1  = alg.MkBitTrue(j);
            var bit_i_is0  = alg.MkBitFalse(i);
            var subsetCond = alg.MkOr(bit_j_is1, bit_i_is0);
            var moves      = new Move <BDD>[] { new Move <BDD>(0, 0, subsetCond) };
            var aut        = Automaton <BDD> .Create(alg, 0, new int[] { 0 }, moves, false, false, true);

            return(aut);
        }
Exemplo n.º 3
0
        /// <summary>
        /// X_i = X_j
        /// </summary>
        public static Automaton <BDD> MkEqualSets(int i, int j, IBDDAlgebra alg)
        {
            var bit_j_is1 = alg.MkBitTrue(j);
            var bit_i_is1 = alg.MkBitTrue(i);
            var bit_i_is0 = alg.MkBitFalse(i);
            var bit_j_is0 = alg.MkBitFalse(j);
            var cond      = alg.MkOr(alg.MkAnd(bit_i_is1, bit_j_is1), alg.MkAnd(bit_i_is0, bit_j_is0));
            var moves     = new Move <BDD>[] { new Move <BDD>(0, 0, cond) };
            var aut       = Automaton <BDD> .Create(alg, 0, new int[] { 0 }, moves, false, false, true);

            return(aut);
        }
Exemplo n.º 4
0
        public BDD ConvertToCharSet(IBDDAlgebra solver, ulong pred)
        {
            BDD res = solver.False;

            if (!pred.Equals(this.zero))
            {
                for (int i = 0; i < atoms.Length; i++)
                {
                    //construct the union of the corresponding atoms
                    if (!(pred & atoms[i]).Equals(this.zero))
                    {
                        BDD bdd_i = partition[i].AsBDD(solver);
                        res = solver.MkOr(res, bdd_i);
                    }
                }
            }
            return(res);
        }
Exemplo n.º 5
0
        public bool TryConvertToCharSet(IBDDAlgebra solver, BV pred, out BDD set)
        {
            BDD res = solver.False;

            if (!pred.Equals(this.zero))
            {
                for (int i = 0; i < atoms.Length; i++)
                {
                    //construct the union of the corresponding atoms
                    if (!(pred & atoms[i]).Equals(this.zero))
                    {
                        BDD bdd_i = partition[i].AsBDD(solver);
                        res = solver.MkOr(res, bdd_i);
                    }
                }
            }
            set = res;
            return(true);
        }
Exemplo n.º 6
0
 public BDD Or(BDD other)
 {
     return(algebra.MkOr(this, other));
 }