static void DelCount(int u) { BddNode n = Kernel.T[u]; n.refcount--; Kernel.T[u] = n; }
static void AddMark(int u) { BddNode n = Kernel.T[u]; n.mark = true; Kernel.T[u] = n; }
static void AddCount(int u) { BddNode n = Kernel.T[u]; n.refcount++; Kernel.T[u] = n; }
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; }
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); }