Esempio n. 1
0
        private BDDNode AppyToAll(List <GeneLink> froms, int i,
                                  bool value, string func)
        {
            BDDNode app = null;

            foreach (var f in froms)
            {
                var formatParameter = Formater.FormatParameter(f.From, i);

                var param = _nodeStore[formatParameter];

                var node1 =
                    BDDSharpSolver.CreateNodeBasedOnAutomata(
                        formatParameter, true, _manager,
                        param.Index);

                if (func == OR)
                {
                    if (app == null)
                    {
                        app = node1;
                    }
                    else
                    {
                        app = _manager.Or(app, node1);
                    }
                }
                else
                if (func == AND)
                {
                    if (app == null)
                    {
                        app = node1;
                    }
                    else
                    {
                        app = _manager.And(app, node1);
                    }
                }
            }

            if (!value)
            {
                app = _manager.Not(app);
            }

            return(app);
        }
Esempio n. 2
0
 public static BDDNode Equal(this BDDManager manager, BDDNode a, BDDNode b)
 {
     return(manager.ITE(a, b, manager.Not(b)));
 }