Esempio n. 1
0
        public Bdd execute()
        {
            Bdd b      = body.execute();
            Bdd result = new Bdd(false);

            foreach (Var v in vars)
            {
                //Bdd b2 = v.execute();
                //result = BDD.And(BDD.Restrict(b.Var, b2.Var, true), BDD.Restrict(b.Var, b2.Var, false));
                result = BDD.Or(result, BDD.ForAll(v.execute().Var, b));
            }
            b.Dispose();
            return(result);
        }
Esempio n. 2
0
        public static Bdd execute(IBoolExpr AST, string filename)
        {
            if (AST == null)
            {
                return(null);        //Nothing written in textbox, or parser failed.
            }

            BDD.Setup();

            Bdd result = AST.execute();

            result.Serialize(filename, 12);

            return(result);
        }
Esempio n. 3
0
        public Bdd execute()
        {
            // Calls specific methods from Kernel
            Bdd l      = left.execute();
            Bdd r      = right.execute();
            Bdd result = new Bdd(false);

            switch (op)
            {
            case Kind.DIS:
                result = BDD.Or(l, r);
                break;

            case Kind.CON:
                result = BDD.And(l, r);
                break;

            case Kind.BIMP:
                result = BDD.Equal(l, r);
                break;

            case Kind.NAND:
                result = BDD.Nand(l, r);
                break;

            case Kind.XOR:
                result = BDD.Xor(l, r);
                break;

            case Kind.NOR:
                result = BDD.Nor(l, r);
                break;

            case Kind.NOT:
                result = BDD.Not(r);
                break;
            }
            l.Dispose();                //forced garbage collection
            r.Dispose();

            return(result);
        }