Esempio n. 1
0
        /// <summary>
        /// Check whether subSet is a subset of set
        /// [ REFS: '', DEREFS: 'none' ]
        /// </summary>
        public static bool IsSubSet(CUDDNode set, CUDDNode subSet)
        {
            CUDD.Ref(subSet);
            CUDD.Ref(set);
            CUDDNode temp   = CUDD.Function.And(subSet, set);
            bool     result = temp.Equals(subSet);

            CUDD.Deref(temp);
            return(result);
        }
Esempio n. 2
0
        public static List <int> GetNumNodes(List <CUDDNode> dds)
        {
            List <int> result = new List <int>();

            foreach (CUDDNode dd in dds)
            {
                result.Add(CUDD.GetNumNodes(dd));
            }
            return(result);
        }
Esempio n. 3
0
            /// <summary>
            /// Or all CUDDNode in dds
            /// [ REFS: 'result', DEREFS: dds ]
            /// </summary>
            public static CUDDNode Or(List <CUDDNode> dds)
            {
                CUDDNode result = CUDD.Constant(0);

                foreach (CUDDNode dd in dds)
                {
                    result = CUDD.Function.Or(result, dd);
                }

                return(result);
            }
Esempio n. 4
0
            /// <summary>
            /// Return the complement of dds
            /// [ REFS: 'result', DEREFS: 'dds' ]
            /// </summary>
            public static CUDDNode Not(List <CUDDNode> dds)
            {
                CUDDNode result = CUDD.Constant(1);

                foreach (CUDDNode dd in dds)
                {
                    result = CUDD.Function.And(result, CUDD.Function.Not(dd));
                }

                return(result);
            }
Esempio n. 5
0
            /// <summary>
            /// (dd && list[0]) || (dd && list[1]) ...
            /// [ REFS: 'result', DEREFS: dd, list ]
            /// </summary>
            /// <param name="dd"></param>
            /// <param name="list"></param>
            /// <returns></returns>
            public static CUDDNode And(CUDDNode dd, List <CUDDNode> list)
            {
                CUDDNode result = CUDD.Constant(0);

                foreach (CUDDNode dd1 in list)
                {
                    CUDD.Ref(dd);
                    CUDDNode temp = CUDD.Function.And(dd, dd1);
                    result = CUDD.Function.Or(result, temp);
                }
                CUDD.Deref(dd);
                return(result);
            }
Esempio n. 6
0
 /// <summary>
 /// Return the pointer address of the array of boolean variables in the memory
 /// </summary>
 /// <returns></returns>
 public IntPtr GetArrayPointer()
 {
     if (isArrayAllocated)
     {
         return(ptr);
     }
     else
     {
         if (ptr != IntPtr.Zero)
         {
             CUDD.FreeArray(ptr);
         }
         ptr = BuildArray();
         isArrayAllocated = true;
         return(ptr);
     }
 }
Esempio n. 7
0
            /// <summary>
            /// (dd && list[0]) || (dd && list[1]) ...
            /// [ REFS: 'result', DEREFS: dd, list ]
            /// </summary>
            /// <param name="dd"></param>
            /// <param name="list"></param>
            /// <returns></returns>
            public static List <CUDDNode> And(List <CUDDNode> list, CUDDNode dd)
            {
                List <CUDDNode> result = new List <CUDDNode>();

                foreach (CUDDNode dd1 in list)
                {
                    CUDD.Ref(dd);
                    CUDDNode temp = CUDD.Function.And(dd, dd1);
                    if (temp.Equals(CUDD.ZERO))
                    {
                        CUDD.Deref(temp);
                    }
                    else
                    {
                        result.Add(temp);
                    }
                }
                CUDD.Deref(dd);
                return(result);
            }
Esempio n. 8
0
 public CUDDNode GetElse()
 {
     return(CUDD.GetElse(this));
 }
Esempio n. 9
0
 public CUDDNode GetThen()
 {
     return(CUDD.GetThen(this));
 }
Esempio n. 10
0
 public double GetValue()
 {
     return(CUDD.GetValue(this));
 }
Esempio n. 11
0
 public int GetIndex()
 {
     return(CUDD.GetIndex(this));
 }
Esempio n. 12
0
 /// <summary>
 /// Check whether the represented boolean expression is actually a constant
 /// </summary>
 /// <returns></returns>
 public bool IsConstant()
 {
     return(CUDD.IsConstant(this));
 }
Esempio n. 13
0
 public void Deref()
 {
     CUDD.Deref(this.vars);
 }
Esempio n. 14
0
 public void Ref()
 {
     CUDD.Ref(this.vars);
 }