public static void Setup() { T = new BddTable(); H = new BDDHash(0x100000); MarkAndSweep.dic.Clear(); G.Clear(); maxVar = 1; MaxU = 1; T.Add(bddfalse, new BddNode(int.MaxValue)); T.Add(bddtrue, new BddNode(int.MaxValue)); }
public static void Setup() { ithsw.Reset(); applysw.Reset(); GCsw.Reset(); MKsw.Reset(); addrefsw.Reset(); T = new BddTable(0x100000); H = new BDDHash(0x100000); MarkAndSweep.dic.Clear(); G.Clear(); maxVar = 1; MaxU = 1; T.Add(bddfalse, new BddNode(int.MaxValue)); T.Add(bddtrue, new BddNode(int.MaxValue)); }
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; }
public static int Ithvar(int var) { if (var > maxVar) { maxVar = var; } if (H.NeedResize) { resize = true; } if (H.ContainsKey(var, bddfalse, bddtrue)) { return(H[var, bddfalse, bddtrue]); //return lookup } MaxU++; H.Add(var, bddfalse, bddtrue, MaxU); T.Add(MaxU, new BddNode(var)); return(MaxU); }