Esempio n. 1
0
        static void DelCount(int u)
        {
            BddNode n = Kernel.T[u];

            n.refcount--;
            Kernel.T[u] = n;
        }
Esempio n. 2
0
        static void AddMark(int u)
        {
            BddNode n = Kernel.T[u];

            n.mark      = true;
            Kernel.T[u] = n;
        }
Esempio n. 3
0
        static void AddCount(int u)
        {
            BddNode n = Kernel.T[u];

            n.refcount++;
            Kernel.T[u] = n;
        }
Esempio n. 4
0
        public static void GarbageCollect(ref BDDHash H, ref BddTable T)
        {
            foreach (KeyValuePair <int, int> root in dic)
            {
                int u = root.Key;
                Mark(u);
            }
            int size = H.Size;

            H = new BDDHash(size * 2);
            Kernel.G.Clear();
            BddTable newT = new BddTable(size * 2);

            foreach (BddTableEntry entry in T)
            {
                if (entry.node.mark == true)
                {
                    BddNode n = entry.node;
                    if (!Kernel.IsIthNode(entry.u) && !Kernel.IsTerminal(entry.u))
                    {
                        n.mark = false;
                    }
                    newT.Add(entry.u, n);
                    H.Add(entry.node.var, entry.node.low, entry.node.high, entry.u);
                }
            }
            T = newT;
        }
Esempio n. 5
0
        static void DelNode(int u)
        {
            BddNode n   = Kernel.T[u];
            long    key = ((long)n.var << 48) + ((long)n.low << 24) + ((long)n.high);

            Kernel.H.Remove(key);
            Kernel.T.Remove(u);
        }