You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
(6) |
Apr
(6) |
May
(4) |
Jun
(31) |
Jul
(64) |
Aug
(19) |
Sep
(28) |
Oct
(50) |
Nov
(25) |
Dec
|
2005 |
Jan
(44) |
Feb
(8) |
Mar
(2) |
Apr
(15) |
May
(48) |
Jun
(8) |
Jul
(7) |
Aug
|
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
(14) |
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
(4) |
2007 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John W. <joe...@us...> - 2004-08-27 01:02:44
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7373 Modified Files: javabdd.jardesc Log Message: Index: javabdd.jardesc =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/javabdd.jardesc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** javabdd.jardesc 28 Jun 2004 08:02:45 -0000 1.3 --- javabdd.jardesc 27 Aug 2004 01:02:35 -0000 1.4 *************** *** 1,20 **** ! <?xml version="1.0" encoding="UTF-8"?> ! <jardesc> ! <jar path="JavaBDD/javabdd.jar"/> ! <options overwrite="true" compress="true" exportErrors="true" ! exportWarnings="true" saveDescription="true" ! descriptionLocation="/JavaBDD/javabdd.jardesc" ! useSourceFolders="false" buildIfNeeded="true"/> ! <manifest manifestVersion="1.0" usesManifest="true" ! reuseManifest="false" saveManifest="false" ! generateManifest="false" manifestLocation="/JavaBDD/javabddManifest"> ! <sealing sealJar="false"> ! <packagesToSeal/> ! <packagesToUnSeal/> ! </sealing> ! </manifest> ! <selectedElements exportClassFiles="true" exportJavaFiles="false"> ! <javaElement handleIdentifier="=JavaBDD/<org.sf.javabdd"/> ! <javaElement handleIdentifier="=JavaBDD/<"/> ! </selectedElements> ! </jardesc> --- 1,15 ---- ! <?xml version="1.0" encoding="UTF-8"?> ! <jardesc> ! <jar path="JavaBDD/javabdd.jar"/> ! <options buildIfNeeded="true" compress="true" descriptionLocation="/JavaBDD/javabdd.jardesc" exportErrors="true" exportWarnings="true" overwrite="true" saveDescription="true" useSourceFolders="false"/> ! <manifest generateManifest="false" manifestLocation="/JavaBDD/javabddManifest" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true"> ! <sealing sealJar="false"> ! <packagesToSeal/> ! <packagesToUnSeal/> ! </sealing> ! </manifest> ! <selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false"> ! <javaElement handleIdentifier="=JavaBDD/<org.sf.javabdd"/> ! <javaElement handleIdentifier="=JavaBDD/<"/> ! </selectedElements> ! </jardesc> |
From: John W. <joe...@us...> - 2004-08-27 01:01:51
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7240/org/sf/javabdd Modified Files: FindBestOrder.java Log Message: Index: FindBestOrder.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/FindBestOrder.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FindBestOrder.java 29 Jul 2004 03:43:21 -0000 1.9 --- FindBestOrder.java 27 Aug 2004 01:01:39 -0000 1.10 *************** *** 115,119 **** --- 115,122 ---- } t.stop(); + Thread.yield(); // Help ThreadDeath exception to propagate. if (t.totalTime == Long.MAX_VALUE) { + System.out.println("Thread taking too long, aborted."); + System.out.print("Free memory: "+Runtime.getRuntime().freeMemory()); b1 = null; b2 = null; *************** *** 122,125 **** --- 125,129 ---- newbdd = true; System.gc(); + System.out.println(" bytes -> "+Runtime.getRuntime().freeMemory()+" bytes"); } if (t.time < bestCalcTime) { |
From: John W. <joe...@us...> - 2004-08-21 02:22:53
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9426 Modified Files: project.properties Log Message: Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** project.properties 2 Aug 2004 20:59:45 -0000 1.6 --- project.properties 21 Aug 2004 02:22:40 -0000 1.7 *************** *** 3,6 **** --- 3,8 ---- #maven.src.dir = . + maven.compile.source = 1.3 + # The string to look for in TODO tags, used by tasklist plugin. #maven.tasklist.taskTag = TODO |
From: Jim Z. <jz...@us...> - 2004-08-12 23:26:12
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30082/org/sf/javabdd Modified Files: BDD.java Log Message: Fixed bug Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDD.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** BDD.java 12 Aug 2004 21:23:40 -0000 1.35 --- BDD.java 12 Aug 2004 23:26:03 -0000 1.36 *************** *** 854,857 **** --- 854,858 ---- public boolean isDontCare(int var) { + if (nodes == null) return false; if (levels == null) throw new BDDException(); *************** *** 864,867 **** --- 865,869 ---- public boolean isDontCare(BDDDomain d) { + if (nodes == null) return false; int[] vars = d.vars(); for (int i = 0; i < vars.length; ++i) { |
From: John W. <joe...@us...> - 2004-08-12 21:23:48
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8164/org/sf/javabdd Modified Files: BDD.java Log Message: Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDD.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** BDD.java 12 Aug 2004 21:18:27 -0000 1.34 --- BDD.java 12 Aug 2004 21:23:40 -0000 1.35 *************** *** 858,863 **** int level = factory.var2Level(var); int i = Arrays.binarySearch(levels, level); ! if (i == -1) ! throw new BDDException(); return nodes[i] == null; } --- 858,863 ---- int level = factory.var2Level(var); int i = Arrays.binarySearch(levels, level); ! if (i < 0) ! throw new BDDException("var "+var+" not in iteration set"); return nodes[i] == null; } *************** *** 876,880 **** int level = factory.var2Level(var); int i = Arrays.binarySearch(levels, level); ! if (i == -1) throw new BDDException(); if (nodes[i] != null) --- 876,880 ---- int level = factory.var2Level(var); int i = Arrays.binarySearch(levels, level); ! if (i < 0) throw new BDDException(); if (nodes[i] != null) |
From: John W. <joe...@us...> - 2004-08-12 21:18:37
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6966/org/sf/javabdd Modified Files: BDD.java TypedBDDFactory.java Log Message: Update to new tuple iterator. Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDD.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** BDD.java 9 Aug 2004 21:48:42 -0000 1.33 --- BDD.java 12 Aug 2004 21:18:27 -0000 1.34 *************** *** 1,4 **** --- 1,5 ---- package org.sf.javabdd; + import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; *************** *** 700,837 **** * @return an iteration of minterms */ ! public Iterator iterator(final BDD var) { ! return new Iterator() { ! int[] levels; ! boolean[] values; ! BDD[] nodes; ! boolean more; ! ! { ! if (!BDD.this.isZero()) { ! levels = varset2levels(var); ! values = new boolean[levels.length]; ! nodes = new BDD[levels.length]; ! fillInSatisfyingAssignment(BDD.this.id(), 0); ! more = true; ! } } ! ! void fillInSatisfyingAssignment(BDD node, int i) { ! while (!node.isOne() && !node.isZero()) { ! int v = node.level(); ! ! // Mark skipped variables as dont-cares. ! int j = i; ! while (j < levels.length && levels[j] != v) { ! if (nodes[j] != null) ! throw new InternalError("nodes["+j+"] should be null"); ! ++j; ! } ! if (j == levels.length) ! throw new BDDException("BDD contains variable not in iteration set: "+getFactory().level2Var(v)); ! i = j; ! ! // Put node in table. ! nodes[i] = node; ! ! // Choose zero edge. ! BDD node2 = node.low(); ! if (node2.isZero()) { ! // Zero edge is F. Choose one edge instead. ! node2.free(); ! values[i] = true; ! node2 = node.high(); ! } ! node = node2; ! ++i; } } ! ! boolean findNextSatisfyingAssignment() { ! int i = nodes.length - 1; ! for (;;) { ! if (i < 0) return false; ! if (nodes[i] != null) { ! if (!values[i]) { ! // We already tried zero, try a one here now. ! BDD hi = nodes[i].high(); ! if (!hi.isZero()) { ! values[i] = true; ! fillInSatisfyingAssignment(hi, i+1); ! return true; ! } else { ! // Leads to zero, no satisfying assignments. ! // Fallthrough. ! } } - // We already tried both zero and one. - nodes[i].free(); - nodes[i] = null; - values[i] = false; - // Fallthrough: Go to next bit. - } else { - // This is a dont-care bit, skip it. } ! --i; } } ! ! BDD buildAssignment() { ! more = false; ! BDD b = getFactory().one(); ! boolean carry = true; ! for (int i = levels.length - 1; i >= 0; --i) { ! int level = levels[i]; ! int var = getFactory().level2Var(level); ! boolean val = values[i]; ! if (nodes[i] == null) { ! if (carry) { ! values[i] = !val; ! more |= !val; ! carry = val; ! } else { ! more = true; ! } } - BDD v = val ? getFactory().ithVar(var) : getFactory().nithVar(var); - b.andWith(v); } - return b; } ! ! void free() { ! for (int i = levels.length - 1; i >= 0; --i) { ! if (nodes[i] != null) { ! nodes[i].free(); ! nodes[i] = null; } } ! nodes = null; } ! ! public Object next() { ! BDD b; ! if (more) { ! b = buildAssignment(); ! } else { ! throw new NoSuchElementException(); } if (!more) { ! more = findNextSatisfyingAssignment(); ! if (!more) { ! free(); ! } } - return b; } ! ! public boolean hasNext() { ! return nodes != null; } ! ! public void remove() { ! throw new UnsupportedOperationException(); } ! }; } --- 701,899 ---- * @return an iteration of minterms */ ! public BDDIterator iterator(final BDD var) { ! return new BDDIterator(this, var); ! } ! ! public static class BDDIterator implements Iterator { ! BDDFactory factory; ! int[] levels; ! boolean[] values; ! BDD[] nodes = null; ! boolean more = false; ! ! public BDDIterator(BDD dis, BDD var){ ! factory = dis.getFactory(); ! if (!dis.isZero()) { ! levels = varset2levels(var); ! values = new boolean[levels.length]; ! nodes = new BDD[levels.length]; ! fillInSatisfyingAssignment(dis.id(), 0); ! more = true; } ! } ! ! void fillInSatisfyingAssignment(BDD node, int i) { ! while (!node.isOne() && !node.isZero()) { ! int v = node.level(); ! ! // Mark skipped variables as dont-cares. ! int j = i; ! while (j < levels.length && levels[j] != v) { ! if (nodes[j] != null) ! throw new InternalError("nodes["+j+"] should be null"); ! ++j; ! } ! if (j == levels.length) ! throw new BDDException("BDD contains variable not in iteration set: "+factory.level2Var(v)); ! i = j; ! ! // Put node in table. ! nodes[i] = node; ! ! // Choose zero edge. ! BDD node2 = node.low(); ! if (node2.isZero()) { ! // Zero edge is F. Choose one edge instead. ! node2.free(); ! values[i] = true; ! node2 = node.high(); } + node = node2; + ++i; } ! } ! ! boolean findNextSatisfyingAssignment() { ! int i = nodes.length - 1; ! for (;;) { ! if (i < 0) return false; ! if (nodes[i] != null) { ! if (!values[i]) { ! // We already tried zero, try a one here now. ! BDD hi = nodes[i].high(); ! if (!hi.isZero()) { ! values[i] = true; ! fillInSatisfyingAssignment(hi, i+1); ! return true; ! } else { ! // Leads to zero, no satisfying assignments. ! // Fallthrough. } } ! // We already tried both zero and one. ! nodes[i].free(); ! nodes[i] = null; ! values[i] = false; ! // Fallthrough: Go to next bit. ! } else { ! // This is a dont-care bit, skip it. } + --i; } ! } ! ! void increment() { ! more = false; ! boolean carry = true; ! for (int i = levels.length - 1; i >= 0; --i) { ! boolean val = values[i]; ! if (nodes[i] == null) { ! if (carry) { ! values[i] = !val; ! more |= !val; ! carry = val; } } } ! } ! ! BDD buildAndIncrement() { ! more = false; ! BDD b = factory.one(); ! boolean carry = true; ! for (int i = levels.length - 1; i >= 0; --i) { ! int level = levels[i]; ! int var = factory.level2Var(level); ! boolean val = values[i]; ! if (nodes[i] == null) { ! if (carry) { ! values[i] = !val; ! more |= !val; ! carry = val; } } ! BDD v = val ? factory.ithVar(var) : factory.nithVar(var); ! b.andWith(v); } ! return b; ! } ! ! void free() { ! for (int i = levels.length - 1; i >= 0; --i) { ! if (nodes[i] != null) { ! nodes[i].free(); ! nodes[i] = null; } + } + nodes = null; + } + + public Object next() { + BDD b; + if (more) { + b = buildAndIncrement(); + } else { + throw new NoSuchElementException(); + } + if (!more) { + more = findNextSatisfyingAssignment(); if (!more) { ! free(); } } ! return b; ! } ! ! public boolean hasNext() { ! return nodes != null; ! } ! ! public void remove() { ! throw new UnsupportedOperationException(); ! } ! ! public boolean isDontCare(int var) { ! if (levels == null) ! throw new BDDException(); ! int level = factory.var2Level(var); ! int i = Arrays.binarySearch(levels, level); ! if (i == -1) ! throw new BDDException(); ! return nodes[i] == null; ! } ! ! public boolean isDontCare(BDDDomain d) { ! int[] vars = d.vars(); ! for (int i = 0; i < vars.length; ++i) { ! if (!isDontCare(vars[i])) return false; } ! return true; ! } ! ! void fastForward0(int var) { ! if (levels == null) ! throw new BDDException(); ! int level = factory.var2Level(var); ! int i = Arrays.binarySearch(levels, level); ! if (i == -1) ! throw new BDDException(); ! if (nodes[i] != null) ! throw new BDDException(); ! values[i] = true; ! } ! ! public void fastForward(int var) { ! fastForward0(var); ! //increment(); ! } ! ! public void skipDontCare(BDDDomain d) { ! int[] vars = d.vars(); ! for (int i = 0; i < vars.length; ++i) { ! fastForward0(vars[i]); } ! //increment(); ! } ! } *************** *** 844,853 **** */ public Iterator iterator2(final BDD var) { - final BDD b = id(); - final BDD zero = getFactory().zero(); return new Iterator() { ! BDD last; ! public void remove() { if (last != null) { --- 906,923 ---- */ public Iterator iterator2(final BDD var) { return new Iterator() { ! BDD b = null; ! BDD zero; ! BDD myVar; ! BDD last = null; ! { ! if (!isZero()) { ! b = id(); ! zero = getFactory().zero(); ! myVar = var.id(); ! } ! } ! public void remove() { if (last != null) { *************** *** 860,869 **** public boolean hasNext() { ! return !b.isZero(); } public Object next() { ! BDD c = b.satOne(var, zero); b.applyWith(c.id(), BDDFactory.diff); return last = c; } --- 930,946 ---- public boolean hasNext() { ! return b != null; } public Object next() { ! if (b == null) ! throw new NoSuchElementException(); ! BDD c = b.satOne(myVar, zero); b.applyWith(c.id(), BDDFactory.diff); + if (b.isZero()) { + myVar.free(); myVar = null; + b.free(); b = null; + zero.free(); zero = null; + } return last = c; } *************** *** 1392,1399 **** BDDFactory bdd = BDDFactory.init(1000, 1000); int domainSize = 1024; ! BDDDomain d = bdd.extDomain(new int[] { domainSize })[0]; Random r = new Random(); int times = 1000; ! int combine = 200; for (int i = 0; i < times; ++i) { int count = r.nextInt(combine); --- 1469,1478 ---- BDDFactory bdd = BDDFactory.init(1000, 1000); int domainSize = 1024; ! bdd.extDomain(new int[] { domainSize, domainSize }); ! BDDDomain d = bdd.getDomain(0); ! BDDDomain d2 = bdd.getDomain(1); Random r = new Random(); int times = 1000; ! int combine = 400; for (int i = 0; i < times; ++i) { int count = r.nextInt(combine); *************** *** 1401,1405 **** for (int j = 0; j < count; ++j) { int varNum = r.nextInt(domainSize); ! b.orWith(d.ithVar(varNum)); } BDD var = d.set(); --- 1480,1485 ---- for (int j = 0; j < count; ++j) { int varNum = r.nextInt(domainSize); ! BDD c = d.ithVar(varNum); //.andWith(d2.ithVar(domainSize - varNum - 1)); ! b.orWith(c); } BDD var = d.set(); Index: TypedBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/TypedBDDFactory.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TypedBDDFactory.java 2 Aug 2004 20:20:53 -0000 1.18 --- TypedBDDFactory.java 12 Aug 2004 21:18:27 -0000 1.19 *************** *** 983,987 **** } ! public Iterator iterator(BDD var) { TypedBDD bdd1 = (TypedBDD) var; if (!dom.equals(bdd1.dom)) { --- 983,987 ---- } ! public BDDIterator iterator(BDD var) { TypedBDD bdd1 = (TypedBDD) var; if (!dom.equals(bdd1.dom)) { *************** *** 991,995 **** } ! public Iterator iterator() { Set newDom = makeSet(); newDom.addAll(dom); --- 991,995 ---- } ! public BDDIterator iterator() { Set newDom = makeSet(); newDom.addAll(dom); |
From: John W. <joe...@us...> - 2004-08-09 21:49:02
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv765/org/sf/javabdd Modified Files: BDD.java BDDDomain.java Log Message: Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDD.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** BDD.java 9 Aug 2004 21:31:19 -0000 1.32 --- BDD.java 9 Aug 2004 21:48:42 -0000 1.33 *************** *** 1406,1420 **** Iterator i1 = b.iterator(var); Iterator i2 = b.iterator2(var); ! var.free(); b.free(); Set s1 = new HashSet(); Set s2 = new HashSet(); while (i1.hasNext()) { BDD b1 = (BDD) i1.next(); s1.add(b1); } while (i2.hasNext()) { BDD b2 = (BDD) i2.next(); s2.add(b2); } if (!s1.equals(s2)) { Set s1_minus_s2 = new HashSet(s1); --- 1406,1429 ---- Iterator i1 = b.iterator(var); Iterator i2 = b.iterator2(var); ! b.free(); Set s1 = new HashSet(); Set s2 = new HashSet(); while (i1.hasNext()) { BDD b1 = (BDD) i1.next(); + double sc = b1.satCount(var); + if (sc != 1.) { + System.out.println("Error, iterator() returned BDD with satcount "+sc+" : "+b1); + } s1.add(b1); } while (i2.hasNext()) { BDD b2 = (BDD) i2.next(); + double sc = b2.satCount(var); + if (sc != 1.) { + System.out.println("Error, iterator2() returned BDD with satcount "+sc+" : "+b2); + } s2.add(b2); } + var.free(); if (!s1.equals(s2)) { Set s1_minus_s2 = new HashSet(s1); Index: BDDDomain.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDDDomain.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** BDDDomain.java 30 Jul 2004 21:04:40 -0000 1.17 --- BDDDomain.java 9 Aug 2004 21:48:42 -0000 1.18 *************** *** 114,118 **** if (bits > this.varNum() || bits > that.varNum()) ! throw new BDDException(); BDDFactory bdd = getFactory(); --- 114,118 ---- if (bits > this.varNum() || bits > that.varNum()) ! throw new BDDException("Number of bits requested ("+bits+") is larger than domain sizes "+this.varNum()+","+that.varNum()); BDDFactory bdd = getFactory(); |
From: John W. <joe...@us...> - 2004-08-09 21:31:29
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29977/org/sf/javabdd Modified Files: JFactory.java BDD.java Log Message: Better iterator() implementation. Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDD.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** BDD.java 2 Aug 2004 20:32:59 -0000 1.31 --- BDD.java 9 Aug 2004 21:31:19 -0000 1.32 *************** *** 1,8 **** package org.sf.javabdd; - import java.io.PrintStream; import java.util.HashMap; import java.util.Iterator; import java.util.List; /** --- 1,12 ---- package org.sf.javabdd; import java.util.HashMap; + import java.util.HashSet; import java.util.Iterator; import java.util.List; + import java.util.NoSuchElementException; + import java.util.Random; + import java.util.Set; + import java.io.PrintStream; /** *************** *** 666,669 **** --- 670,839 ---- } + static int[] varset2levels(BDD r) { + int size = 0; + BDD p = r.id(); + while (!p.isOne() && !p.isZero()) { + ++size; + BDD p2 = p.high(); + p.free(); + p = p2; + } + p.free(); + int[] result = new int[size]; + size = -1; + p = r.id(); + while (!p.isOne() && !p.isZero()) { + result[++size] = p.level(); + BDD p2 = p.high(); + p.free(); + p = p2; + } + p.free(); + return result; + } + + /** + * <p>Returns an iteration of the satisfying assignments of this BDD. Returns + * an iteration of minterms. The var argument is the set of variables that + * will be mentioned in the result.</p> + * + * @return an iteration of minterms + */ + public Iterator iterator(final BDD var) { + return new Iterator() { + int[] levels; + boolean[] values; + BDD[] nodes; + boolean more; + + { + if (!BDD.this.isZero()) { + levels = varset2levels(var); + values = new boolean[levels.length]; + nodes = new BDD[levels.length]; + fillInSatisfyingAssignment(BDD.this.id(), 0); + more = true; + } + } + + void fillInSatisfyingAssignment(BDD node, int i) { + while (!node.isOne() && !node.isZero()) { + int v = node.level(); + + // Mark skipped variables as dont-cares. + int j = i; + while (j < levels.length && levels[j] != v) { + if (nodes[j] != null) + throw new InternalError("nodes["+j+"] should be null"); + ++j; + } + if (j == levels.length) + throw new BDDException("BDD contains variable not in iteration set: "+getFactory().level2Var(v)); + i = j; + + // Put node in table. + nodes[i] = node; + + // Choose zero edge. + BDD node2 = node.low(); + if (node2.isZero()) { + // Zero edge is F. Choose one edge instead. + node2.free(); + values[i] = true; + node2 = node.high(); + } + node = node2; + ++i; + } + } + + boolean findNextSatisfyingAssignment() { + int i = nodes.length - 1; + for (;;) { + if (i < 0) return false; + if (nodes[i] != null) { + if (!values[i]) { + // We already tried zero, try a one here now. + BDD hi = nodes[i].high(); + if (!hi.isZero()) { + values[i] = true; + fillInSatisfyingAssignment(hi, i+1); + return true; + } else { + // Leads to zero, no satisfying assignments. + // Fallthrough. + } + } + // We already tried both zero and one. + nodes[i].free(); + nodes[i] = null; + values[i] = false; + // Fallthrough: Go to next bit. + } else { + // This is a dont-care bit, skip it. + } + --i; + } + } + + BDD buildAssignment() { + more = false; + BDD b = getFactory().one(); + boolean carry = true; + for (int i = levels.length - 1; i >= 0; --i) { + int level = levels[i]; + int var = getFactory().level2Var(level); + boolean val = values[i]; + if (nodes[i] == null) { + if (carry) { + values[i] = !val; + more |= !val; + carry = val; + } else { + more = true; + } + } + BDD v = val ? getFactory().ithVar(var) : getFactory().nithVar(var); + b.andWith(v); + } + return b; + } + + void free() { + for (int i = levels.length - 1; i >= 0; --i) { + if (nodes[i] != null) { + nodes[i].free(); + nodes[i] = null; + } + } + nodes = null; + } + + public Object next() { + BDD b; + if (more) { + b = buildAssignment(); + } else { + throw new NoSuchElementException(); + } + if (!more) { + more = findNextSatisfyingAssignment(); + if (!more) { + free(); + } + } + return b; + } + + public boolean hasNext() { + return nodes != null; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + /** * <p>Returns an iteration of the satisfying assignments of this BDD. Returns *************** *** 673,677 **** * @return an iteration of minterms */ ! public Iterator iterator(final BDD var) { final BDD b = id(); final BDD zero = getFactory().zero(); --- 843,847 ---- * @return an iteration of minterms */ ! public Iterator iterator2(final BDD var) { final BDD b = id(); final BDD zero = getFactory().zero(); *************** *** 1219,1221 **** --- 1389,1438 ---- protected BDD() { } + public static void main(String[] args) { + BDDFactory bdd = BDDFactory.init(1000, 1000); + int domainSize = 1024; + BDDDomain d = bdd.extDomain(new int[] { domainSize })[0]; + Random r = new Random(); + int times = 1000; + int combine = 200; + for (int i = 0; i < times; ++i) { + int count = r.nextInt(combine); + BDD b = bdd.zero(); + for (int j = 0; j < count; ++j) { + int varNum = r.nextInt(domainSize); + b.orWith(d.ithVar(varNum)); + } + BDD var = d.set(); + Iterator i1 = b.iterator(var); + Iterator i2 = b.iterator2(var); + var.free(); b.free(); + Set s1 = new HashSet(); + Set s2 = new HashSet(); + while (i1.hasNext()) { + BDD b1 = (BDD) i1.next(); + s1.add(b1); + } + while (i2.hasNext()) { + BDD b2 = (BDD) i2.next(); + s2.add(b2); + } + if (!s1.equals(s2)) { + Set s1_minus_s2 = new HashSet(s1); + s1_minus_s2.removeAll(s2); + Set s2_minus_s1 = new HashSet(s2); + s2_minus_s1.removeAll(s1); + System.out.println("iterator() contains these extras: "+s1_minus_s2); + System.out.println("iterator2() contains these extras: "+s2_minus_s1); + } + for (Iterator k = s1.iterator(); k.hasNext(); ) { + BDD q = (BDD) k.next(); + q.free(); + } + for (Iterator k = s2.iterator(); k.hasNext(); ) { + BDD q = (BDD) k.next(); + q.free(); + } + } + } + } Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/JFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JFactory.java 2 Aug 2004 20:20:53 -0000 1.7 --- JFactory.java 9 Aug 2004 21:31:11 -0000 1.8 *************** *** 302,306 **** /* (non-Javadoc) ! * @see org.sf.javabdd.BDD#satOneSet(org.sf.javabdd.BDD, org.sf.javabdd.BDD) */ public BDD satOne(BDD var, BDD pol) { --- 302,306 ---- /* (non-Javadoc) ! * @see org.sf.javabdd.BDD#satOne(org.sf.javabdd.BDD, org.sf.javabdd.BDD) */ public BDD satOne(BDD var, BDD pol) { |
From: John W. <joe...@us...> - 2004-08-02 23:21:55
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28419 Modified Files: project.xml Log Message: Added timezone. Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** project.xml 2 Aug 2004 20:59:45 -0000 1.11 --- project.xml 2 Aug 2004 23:21:47 -0000 1.12 *************** *** 139,142 **** --- 139,143 ---- <role>Project Manager</role> </roles> + <timezone>-8</timezone> </developer> |
From: John W. <joe...@us...> - 2004-08-02 20:59:54
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2042 Modified Files: project.xml project.properties Log Message: Remove utterly useless dashboard report. Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** project.properties 2 Aug 2004 20:44:47 -0000 1.5 --- project.properties 2 Aug 2004 20:59:45 -0000 1.6 *************** *** 31,32 **** --- 31,35 ---- maven.javadoc.private = false #maven.javadoc.overview = docs/overview.html + + # Properties for dashboard + #maven.dashboard.aggregators = junittests,junitfailures,juniterrors,junitpassrate Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** project.xml 2 Aug 2004 20:46:04 -0000 1.10 --- project.xml 2 Aug 2004 20:59:45 -0000 1.11 *************** *** 238,244 **** </report> <report> - maven-dashboard-plugin - </report> - <report> maven-javadoc-plugin </report> --- 238,241 ---- |
From: John W. <joe...@us...> - 2004-08-02 20:46:16
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31836 Modified Files: project.xml Log Message: Fix link. Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** project.xml 2 Aug 2004 20:44:47 -0000 1.9 --- project.xml 2 Aug 2004 20:46:04 -0000 1.10 *************** *** 8,12 **** <organization> <name>John Whaley</name> ! <url>http://www.stanford.edu/~jwhaley</url> <logo>http://sourceforge.net/sflogo.php?group_id=72725&type=5</logo> </organization> --- 8,12 ---- <organization> <name>John Whaley</name> ! <url>http://sourceforge.net</url> <logo>http://sourceforge.net/sflogo.php?group_id=72725&type=5</logo> </organization> *************** *** 43,47 **** <url>http://javabdd.sourceforge.net/</url> <issueTrackingUrl> ! http://www.sourceforge.net/tracker/?group_id=72725 </issueTrackingUrl> <siteAddress>javabdd.sourceforge.net</siteAddress> --- 43,47 ---- <url>http://javabdd.sourceforge.net/</url> <issueTrackingUrl> ! http://sourceforge.net/tracker/?group_id=72725 </issueTrackingUrl> <siteAddress>javabdd.sourceforge.net</siteAddress> |
From: John W. <joe...@us...> - 2004-08-02 20:45:00
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31554 Modified Files: project.xml project.properties Log Message: Updates. Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** project.properties 28 Jul 2004 11:56:07 -0000 1.4 --- project.properties 2 Aug 2004 20:44:47 -0000 1.5 *************** *** 1,5 **** # Where to find source code, used by tasklist plugin. ! maven.src.dir = . # Tell maven where to find jdd.jar, because it cannot build it itself. --- 1,8 ---- # Where to find source code, used by tasklist plugin. ! #maven.src.dir = . ! ! # The string to look for in TODO tags, used by tasklist plugin. ! #maven.tasklist.taskTag = TODO # Tell maven where to find jdd.jar, because it cannot build it itself. *************** *** 22,23 **** --- 25,32 ---- maven.native.src = . maven.native.src.includes = buddy/src/*.c buddy/src/*.h buddy_jni.c + + # Properties for Javadoc generation. + maven.javadoc.links = http://java.sun.com/j2se/1.4.2/docs/api/ + maven.javadoc.protected = true + maven.javadoc.private = false + #maven.javadoc.overview = docs/overview.html Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** project.xml 1 Aug 2004 08:41:35 -0000 1.8 --- project.xml 2 Aug 2004 20:44:47 -0000 1.9 *************** *** 7,12 **** <logo>/images/logo2_mid.jpg</logo> <organization> ! <name>Sourceforge</name> ! <url>http://sourceforge.net</url> <logo>http://sourceforge.net/sflogo.php?group_id=72725&type=5</logo> </organization> --- 7,12 ---- <logo>/images/logo2_mid.jpg</logo> <organization> ! <name>John Whaley</name> ! <url>http://www.stanford.edu/~jwhaley</url> <logo>http://sourceforge.net/sflogo.php?group_id=72725&type=5</logo> </organization> *************** *** 238,242 **** </report> <report> ! maven-tasklist-plugin </report> <report> --- 238,242 ---- </report> <report> ! maven-dashboard-plugin </report> <report> *************** *** 246,249 **** --- 246,255 ---- maven-jxr-plugin </report> + <report> + maven-findbugs-plugin + </report> + <report> + maven-linkcheck-plugin + </report> <!-- TOO EXPENSIVE <report> |
From: John W. <joe...@us...> - 2004-08-02 20:33:10
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28788/org/sf/javabdd Modified Files: BDDFactory.java BDD.java Log Message: Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDD.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** BDD.java 24 Jul 2004 01:15:35 -0000 1.30 --- BDD.java 2 Aug 2004 20:32:59 -0000 1.31 *************** *** 991,995 **** } ! static class OutputBuffer { BDDToString ts; StringBuffer sb; --- 991,995 ---- } ! private static class OutputBuffer { BDDToString ts; StringBuffer sb; Index: BDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDDFactory.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** BDDFactory.java 29 Jul 2004 03:43:21 -0000 1.25 --- BDDFactory.java 2 Aug 2004 20:32:59 -0000 1.26 *************** *** 456,460 **** } ! static class LoadHash { int key; BDD data; --- 456,460 ---- } ! private static class LoadHash { int key; BDD data; |
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26212/org/sf/javabdd Modified Files: JFactory.java CALFactory.java BuDDyFactory.java TypedBDDFactory.java TestBDDFactory.java JDDFactory.java CUDDFactory.java Log Message: Make inner classes private. Index: TestBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/TestBDDFactory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TestBDDFactory.java 2 Aug 2004 20:00:58 -0000 1.10 --- TestBDDFactory.java 2 Aug 2004 20:20:53 -0000 1.11 *************** *** 59,63 **** } ! class TestBDD extends BDD { BDD b1, b2; --- 59,63 ---- } ! private class TestBDD extends BDD { BDD b1, b2; *************** *** 863,867 **** } ! static class TestBDDPairing extends BDDPairing { BDDPairing b1, b2; --- 863,867 ---- } ! private static class TestBDDPairing extends BDDPairing { BDDPairing b1, b2; *************** *** 898,902 **** } ! class TestBDDDomain extends BDDDomain { TestBDDDomain(int a, long b) { --- 898,902 ---- } ! private class TestBDDDomain extends BDDDomain { TestBDDDomain(int a, long b) { *************** *** 913,917 **** } ! class TestBDDBitVector extends BDDBitVector { TestBDDBitVector(int a) { --- 913,917 ---- } ! private class TestBDDBitVector extends BDDBitVector { TestBDDBitVector(int a) { Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/JFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JFactory.java 2 Aug 2004 19:57:30 -0000 1.6 --- JFactory.java 2 Aug 2004 20:20:53 -0000 1.7 *************** *** 44,48 **** * Wrapper for the BDD index number used internally in the representation. */ ! class bdd extends BDD { int _index; --- 44,48 ---- * Wrapper for the BDD index number used internally in the representation. */ ! private class bdd extends BDD { int _index; *************** *** 531,540 **** } ! abstract static class BddCacheData { int a, b, c; abstract BddCacheData copy(); } ! static class BddCacheDataI extends BddCacheData { int res; BddCacheData copy() { --- 531,540 ---- } ! private abstract static class BddCacheData { int a, b, c; abstract BddCacheData copy(); } ! private static class BddCacheDataI extends BddCacheData { int res; BddCacheData copy() { *************** *** 548,552 **** } ! static class BddCacheDataD extends BddCacheData { double dres; BddCacheData copy() { --- 548,552 ---- } ! private static class BddCacheDataD extends BddCacheData { double dres; BddCacheData copy() { *************** *** 560,564 **** } ! static class BddCache { BddCacheData table[]; int tablesize; --- 560,564 ---- } ! private static class BddCache { BddCacheData table[]; int tablesize; *************** *** 575,579 **** } ! static class bddCacheStat { int uniqueAccess; int uniqueChain; --- 575,579 ---- } ! public static class bddCacheStat { int uniqueAccess; int uniqueChain; *************** *** 597,601 **** } ! static class JavaBDDException extends BDDException { public JavaBDDException(int x) { super(errorstrings[-x]); --- 597,601 ---- } ! private static class JavaBDDException extends BDDException { public JavaBDDException(int x) { super(errorstrings[-x]); *************** *** 2380,2384 **** } ! static class bddGbcStat { int nodes; int freenodes; --- 2380,2384 ---- } ! public static class bddGbcStat { int nodes; int freenodes; Index: TypedBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/TypedBDDFactory.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TypedBDDFactory.java 2 Aug 2004 20:01:45 -0000 1.17 --- TypedBDDFactory.java 2 Aug 2004 20:20:53 -0000 1.18 *************** *** 420,424 **** }; ! class TypedBDD extends BDD { final BDD bdd; --- 420,430 ---- }; ! /** ! * A BDD with types (domains) attached to it. ! * ! * @author jwhaley ! * @version $Id$ ! */ ! public class TypedBDD extends BDD { final BDD bdd; *************** *** 1001,1005 **** } ! class TypedBDDDomain extends BDDDomain { BDDDomain domain; --- 1007,1011 ---- } ! private class TypedBDDDomain extends BDDDomain { BDDDomain domain; *************** *** 1081,1085 **** } ! static class TypedBDDPairing extends BDDPairing { final Map domMap; --- 1087,1091 ---- } ! private static class TypedBDDPairing extends BDDPairing { final Map domMap; Index: JDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/JDDFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JDDFactory.java 12 Jul 2004 07:08:58 -0000 1.2 --- JDDFactory.java 2 Aug 2004 20:20:53 -0000 1.3 *************** *** 35,39 **** * Wrapper for the BDD index number used internally in the representation. */ ! class bdd extends BDD { int _index; --- 35,39 ---- * Wrapper for the BDD index number used internally in the representation. */ ! private class bdd extends BDD { int _index; Index: BuDDyFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BuDDyFactory.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** BuDDyFactory.java 28 Mar 2004 21:49:47 -0000 1.33 --- BuDDyFactory.java 2 Aug 2004 20:20:53 -0000 1.34 *************** *** 477,481 **** * An implementation of a BDD class, used by the BuDDy interface. */ ! static class BuDDyBDD extends BDD { /** The value used by the BDD library. */ --- 477,481 ---- * An implementation of a BDD class, used by the BuDDy interface. */ ! private static class BuDDyBDD extends BDD { /** The value used by the BDD library. */ *************** *** 902,906 **** } ! static class BuDDyBDDWithFinalizer extends BuDDyBDD { protected BuDDyBDDWithFinalizer(int id) { --- 902,906 ---- } ! private static class BuDDyBDDWithFinalizer extends BuDDyBDD { protected BuDDyBDDWithFinalizer(int id) { *************** *** 930,934 **** * An implementation of a BDDDomain, used by the BuDDy interface. */ ! static class BuDDyBDDDomain extends BDDDomain { private BuDDyBDDDomain(int a, long b) { --- 930,934 ---- * An implementation of a BDDDomain, used by the BuDDy interface. */ ! private static class BuDDyBDDDomain extends BDDDomain { private BuDDyBDDDomain(int a, long b) { *************** *** 946,950 **** * An implementation of a BDDPairing, used by the BuDDy interface. */ ! static class BuDDyBDDPairing extends BDDPairing { private long _ptr; --- 946,950 ---- * An implementation of a BDDPairing, used by the BuDDy interface. */ ! private static class BuDDyBDDPairing extends BDDPairing { private long _ptr; *************** *** 1023,1027 **** * An implementation of a BDDBitVector, used by the BuDDy interface. */ ! static class BuDDyBDDBitVector extends BDDBitVector { private BuDDyBDDBitVector(int a) { --- 1023,1027 ---- * An implementation of a BDDBitVector, used by the BuDDy interface. */ ! private static class BuDDyBDDBitVector extends BDDBitVector { private BuDDyBDDBitVector(int a) { *************** *** 1036,1070 **** } - public static void main(String[] args) { - BDDFactory bdd = init(1000000, 100000); - - BDDDomain[] doms = bdd.extDomain(new int[] {50, 10, 15, 20, 15}); - - BDD b = bdd.one(); - for (int i=0; i<doms.length-1; ++i) { - b.andWith(doms[i].ithVar(i)); - } - - for (int i=0; i<bdd.numberOfDomains(); ++i) { - BDDDomain d = bdd.getDomain(i); - int[] ivar = d.vars(); - System.out.print("Domain #"+i+":"); - for (int j=0; j<ivar.length; ++j) { - System.out.print(' '); - System.out.print(j); - System.out.print(':'); - System.out.print(ivar[j]); - } - System.out.println(); - } - - BDDPairing p = bdd.makePair(doms[2], doms[doms.length-1]); - System.out.println("Pairing: "+p); - - System.out.println("Before replace(): "+b); - BDD c = b.replace(p); - System.out.println("After replace(): "+c); - - bdd.printTable(c); - } } --- 1036,1038 ---- Index: CUDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/CUDDFactory.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CUDDFactory.java 21 Jun 2004 17:35:57 -0000 1.16 --- CUDDFactory.java 2 Aug 2004 20:20:53 -0000 1.17 *************** *** 389,393 **** * An implementation of a BDD class, used by the CUDD interface. */ ! static class CUDDBDD extends BDD { /** The pointer used by the BDD library. */ --- 389,393 ---- * An implementation of a BDD class, used by the CUDD interface. */ ! private static class CUDDBDD extends BDD { /** The pointer used by the BDD library. */ *************** *** 775,779 **** * An implementation of a BDDDomain, used by the CUDD interface. */ ! static class CUDDBDDDomain extends BDDDomain { private CUDDBDDDomain(int index, long range) { --- 775,779 ---- * An implementation of a BDDDomain, used by the CUDD interface. */ ! private static class CUDDBDDDomain extends BDDDomain { private CUDDBDDDomain(int index, long range) { *************** *** 793,797 **** * An implementation of a BDDPairing, used by the CUDD interface. */ ! static class CUDDBDDPairing extends BDDPairing { long _ptr; --- 793,797 ---- * An implementation of a BDDPairing, used by the CUDD interface. */ ! private static class CUDDBDDPairing extends BDDPairing { long _ptr; *************** *** 844,848 **** * An implementation of a BDDBitVector, used by the CUDD interface. */ ! static class CUDDBDDBitVector extends BDDBitVector { private CUDDBDDBitVector(int a) { --- 844,848 ---- * An implementation of a BDDBitVector, used by the CUDD interface. */ ! private static class CUDDBDDBitVector extends BDDBitVector { private CUDDBDDBitVector(int a) { Index: CALFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/CALFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CALFactory.java 28 Jul 2004 03:39:55 -0000 1.4 --- CALFactory.java 2 Aug 2004 20:20:53 -0000 1.5 *************** *** 389,393 **** * An implementation of a BDD class, used by the CAL interface. */ ! static class CALBDD extends BDD { /** The pointer used by the BDD library. */ --- 389,393 ---- * An implementation of a BDD class, used by the CAL interface. */ ! private static class CALBDD extends BDD { /** The pointer used by the BDD library. */ *************** *** 772,776 **** * An implementation of a BDDDomain, used by the CAL interface. */ ! static class CALBDDDomain extends BDDDomain { private CALBDDDomain(int index, long range) { --- 772,776 ---- * An implementation of a BDDDomain, used by the CAL interface. */ ! private static class CALBDDDomain extends BDDDomain { private CALBDDDomain(int index, long range) { *************** *** 790,794 **** * An implementation of a BDDPairing, used by the CAL interface. */ ! static class CALBDDPairing extends BDDPairing { long _ptr; --- 790,794 ---- * An implementation of a BDDPairing, used by the CAL interface. */ ! private static class CALBDDPairing extends BDDPairing { long _ptr; *************** *** 841,845 **** * An implementation of a BDDBitVector, used by the CAL interface. */ ! static class CALBDDBitVector extends BDDBitVector { private CALBDDBitVector(int a) { --- 841,845 ---- * An implementation of a BDDBitVector, used by the CAL interface. */ ! private static class CALBDDBitVector extends BDDBitVector { private CALBDDBitVector(int a) { *************** *** 851,889 **** } - public static void main(String[] args) { - BDDFactory bdd = init(1000000, 100000); - - System.out.println("One: "+CALFactory.one); - System.out.println("Zero: "+CALFactory.zero); - - BDDDomain[] doms = bdd.extDomain(new int[] {50, 10, 15, 20, 15}); - - BDD b = bdd.one(); - for (int i=0; i<doms.length-1; ++i) { - b.andWith(doms[i].ithVar(i)); - } - - for (int i=0; i<bdd.numberOfDomains(); ++i) { - BDDDomain d = bdd.getDomain(i); - int[] ivar = d.vars(); - System.out.print("Domain #"+i+":"); - for (int j=0; j<ivar.length; ++j) { - System.out.print(' '); - System.out.print(j); - System.out.print(':'); - System.out.print(ivar[j]); - } - System.out.println(); - } - - BDDPairing p = bdd.makePair(doms[2], doms[doms.length-1]); - System.out.println("Pairing: "+p); - - System.out.println("Before replace(): "+b); - BDD c = b.replace(p); - System.out.println("After replace(): "+c); - - c.printDot(); - } - } --- 851,853 ---- |
From: John W. <joe...@us...> - 2004-08-02 20:01:55
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22367/org/sf/javabdd Modified Files: TypedBDDFactory.java Log Message: Index: TypedBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/TypedBDDFactory.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TypedBDDFactory.java 11 Jul 2004 11:47:14 -0000 1.16 --- TypedBDDFactory.java 2 Aug 2004 20:01:45 -0000 1.17 *************** *** 420,424 **** }; ! public class TypedBDD extends BDD { final BDD bdd; --- 420,424 ---- }; ! class TypedBDD extends BDD { final BDD bdd; *************** *** 1081,1085 **** } ! class TypedBDDPairing extends BDDPairing { final Map domMap; --- 1081,1085 ---- } ! static class TypedBDDPairing extends BDDPairing { final Map domMap; |
From: John W. <joe...@us...> - 2004-08-02 20:01:06
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22080/org/sf/javabdd Modified Files: TestBDDFactory.java Log Message: Remove "public" class identifiers. Index: TestBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/TestBDDFactory.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestBDDFactory.java 2 Aug 2004 19:59:46 -0000 1.9 --- TestBDDFactory.java 2 Aug 2004 20:00:58 -0000 1.10 *************** *** 59,63 **** } ! public class TestBDD extends BDD { BDD b1, b2; --- 59,63 ---- } ! class TestBDD extends BDD { BDD b1, b2; *************** *** 863,867 **** } ! public static class TestBDDPairing extends BDDPairing { BDDPairing b1, b2; --- 863,867 ---- } ! static class TestBDDPairing extends BDDPairing { BDDPairing b1, b2; |
From: John W. <joe...@us...> - 2004-08-02 19:59:54
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21698/org/sf/javabdd Modified Files: TestBDDFactory.java Log Message: Change TestBDDPairing class to static Index: TestBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/TestBDDFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TestBDDFactory.java 11 Jul 2004 11:47:14 -0000 1.8 --- TestBDDFactory.java 2 Aug 2004 19:59:46 -0000 1.9 *************** *** 863,867 **** } ! public class TestBDDPairing extends BDDPairing { BDDPairing b1, b2; --- 863,867 ---- } ! public static class TestBDDPairing extends BDDPairing { BDDPairing b1, b2; |
From: John W. <joe...@us...> - 2004-08-02 19:57:40
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20998/org/sf/javabdd Modified Files: JFactory.java Log Message: Change SWAPCOUNT to final. Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/JFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JFactory.java 29 Jul 2004 03:43:21 -0000 1.5 --- JFactory.java 2 Aug 2004 19:57:30 -0000 1.6 *************** *** 4769,4773 **** } ! public static boolean SWAPCOUNT = false; int reorder_downSimple(int var0) { --- 4769,4773 ---- } ! public static final boolean SWAPCOUNT = false; int reorder_downSimple(int var0) { |
From: John W. <joe...@us...> - 2004-08-01 08:41:47
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15164 Modified Files: project.xml Log Message: Update text. Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** project.xml 28 Jul 2004 11:38:08 -0000 1.7 --- project.xml 1 Aug 2004 08:41:35 -0000 1.8 *************** *** 19,23 **** <![CDATA[ <p>JavaBDD is a Java library for manipulating BDDs (Binary Decision Diagrams). ! Binary decision diagrams are widely used in model checking, formal verification, optimizing circuit diagrams, etc. For an excellent overview of the BDD data structure, see this set of <a href="http://www.itu.dk/people/hra/notes-index.html"> --- 19,23 ---- <![CDATA[ <p>JavaBDD is a Java library for manipulating BDDs (Binary Decision Diagrams). ! Binary decision diagrams are widely used in model checking, formal verification, optimizing circuit diagrams, etc. For an excellent overview of the BDD data structure, see this set of <a href="http://www.itu.dk/people/hra/notes-index.html"> *************** *** 28,35 **** interface and reference counting schemes have been hidden underneath a uniform, object-oriented interface.</p> ! <p>JavaBDD includes a 100% Java implementation. It can also interface with two popular BDD libraries written in C via a JNI interface: <a href="http://www.itu.dk/research/buddy/"> ! BuDDy</a> and <a href="http://vlsi.colorado.edu/~fabio/CUDD/cuddIntro.html">CUDD</a>. ! </p> <p>JavaBDD is designed for high performance applications, so it also exposes many of the lower level options of the BDD library, like cache sizes and advanced --- 28,38 ---- interface and reference counting schemes have been hidden underneath a uniform, object-oriented interface.</p> ! <p>JavaBDD includes a 100% Java implementation. It can also interface with the ! <a href="http://javaddlib.sourceforge.net/jdd/">JDD</a> library, or with three popular BDD libraries written in C via a JNI interface: <a href="http://www.itu.dk/research/buddy/"> ! BuDDy</a>, <a href="http://vlsi.colorado.edu/~fabio/CUDD/cuddIntro.html">CUDD</a>, ! and <a href="http://www-cad.eecs.berkeley.edu/Research/cal_bdd/">CAL</a>. ! JavaBDD provides a uniform interface to all of these libraries, so you can easily switch between ! them without having to make changes to your application.</p> <p>JavaBDD is designed for high performance applications, so it also exposes many of the lower level options of the BDD library, like cache sizes and advanced |
From: John W. <joe...@us...> - 2004-07-30 21:04:48
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27032/org/sf/javabdd Modified Files: BDDDomain.java Log Message: In buildAdd, support domains of different sizes. Index: BDDDomain.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDDDomain.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BDDDomain.java 24 Jun 2004 08:58:56 -0000 1.16 --- BDDDomain.java 30 Jul 2004 21:04:40 -0000 1.17 *************** *** 126,132 **** result.andWith(b); } ! for ( ; n < that.varNum(); n++) { ! BDD b = bdd.nithVar(this.ivar[n]); ! b.andWith(bdd.nithVar(that.ivar[n])); result.andWith(b); } --- 126,132 ---- result.andWith(b); } ! for ( ; n < Math.max(this.varNum(), that.varNum()); n++) { ! BDD b = (n < this.varNum()) ? bdd.nithVar(this.ivar[n]) : bdd.one(); ! b.andWith((n < that.varNum()) ? bdd.nithVar(that.ivar[n]) : bdd.one()); result.andWith(b); } *************** *** 149,155 **** result.andWith(b); } ! for ( ; n < that.varNum(); n++) { ! BDD b = bdd.nithVar(this.ivar[n]); ! b.andWith(bdd.nithVar(that.ivar[n])); result.andWith(b); } --- 149,155 ---- result.andWith(b); } ! for ( ; n < Math.max(this.varNum(), that.varNum()); n++) { ! BDD b = (n < this.varNum()) ? bdd.nithVar(this.ivar[n]) : bdd.one(); ! b.andWith((n < that.varNum()) ? bdd.nithVar(that.ivar[n]) : bdd.one()); result.andWith(b); } |
From: John W. <joe...@us...> - 2004-07-29 03:43:34
|
Update of /cvsroot/javabdd/JavaBDD/org/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23721/org/sf/javabdd Modified Files: JFactory.java BDDFactory.java FindBestOrder.java Log Message: Change to buffered IO Index: FindBestOrder.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/FindBestOrder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FindBestOrder.java 27 Jul 2004 23:20:03 -0000 1.8 --- FindBestOrder.java 29 Jul 2004 03:43:21 -0000 1.9 *************** *** 5,14 **** import java.util.StringTokenizer; - import java.io.BufferedReader; ! import java.io.DataOutputStream; import java.io.File; - import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.math.BigInteger; --- 5,13 ---- import java.util.StringTokenizer; import java.io.BufferedReader; ! import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; + import java.io.FileWriter; import java.io.IOException; import java.math.BigInteger; *************** *** 91,100 **** public void writeBDDConfig(BDDFactory bdd, String fileName) throws IOException { ! DataOutputStream dos = null; try { ! dos = new DataOutputStream(new FileOutputStream(fileName)); for (int i = 0; i < bdd.numberOfDomains(); ++i) { BDDDomain d = bdd.getDomain(i); ! dos.writeBytes(d.getName()+" "+d.size()+"\n"); } } finally { --- 90,99 ---- public void writeBDDConfig(BDDFactory bdd, String fileName) throws IOException { ! BufferedWriter dos = null; try { ! dos = new BufferedWriter(new FileWriter(fileName)); for (int i = 0; i < bdd.numberOfDomains(); ++i) { BDDDomain d = bdd.getDomain(i); ! dos.write(d.getName()+" "+d.size()+"\n"); } } finally { Index: BDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/BDDFactory.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** BDDFactory.java 28 Jul 2004 09:36:57 -0000 1.24 --- BDDFactory.java 29 Jul 2004 03:43:21 -0000 1.25 *************** *** 8,17 **** import java.util.Map; import java.util.StringTokenizer; ! import java.io.DataInput; ! import java.io.DataInputStream; ! import java.io.DataOutput; ! import java.io.DataOutputStream; ! import java.io.FileInputStream; ! import java.io.FileOutputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; --- 8,15 ---- import java.util.Map; import java.util.StringTokenizer; ! import java.io.BufferedReader; ! import java.io.BufferedWriter; ! import java.io.FileReader; ! import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.InvocationTargetException; *************** *** 364,379 **** */ public BDD load(String filename) throws IOException { ! DataInputStream is = null; try { ! is = new DataInputStream(new FileInputStream(filename)); ! BDD result = load(is); return result; } finally { ! if (is != null) try { is.close(); } catch (IOException _) { } } } // TODO: error code from bdd_load (?) ! public BDD load(DataInput ifile) throws IOException { tokenizer = null; --- 362,377 ---- */ public BDD load(String filename) throws IOException { ! BufferedReader r = null; try { ! r = new BufferedReader(new FileReader(filename)); ! BDD result = load(r); return result; } finally { ! if (r != null) try { r.close(); } catch (IOException _) { } } } // TODO: error code from bdd_load (?) ! public BDD load(BufferedReader ifile) throws IOException { tokenizer = null; *************** *** 448,452 **** StringTokenizer tokenizer; ! String readNext(DataInput ifile) throws IOException { while (tokenizer == null || !tokenizer.hasMoreTokens()) { String s = ifile.readLine(); --- 446,450 ---- StringTokenizer tokenizer; ! String readNext(BufferedReader ifile) throws IOException { while (tokenizer == null || !tokenizer.hasMoreTokens()) { String s = ifile.readLine(); *************** *** 486,492 **** */ public void save(String filename, BDD var) throws IOException { ! DataOutputStream is = null; try { ! is = new DataOutputStream(new FileOutputStream(filename)); save(is, var); } finally { --- 484,490 ---- */ public void save(String filename, BDD var) throws IOException { ! BufferedWriter is = null; try { ! is = new BufferedWriter(new FileWriter(filename)); save(is, var); } finally { *************** *** 496,510 **** // TODO: error code from bdd_save (?) ! public void save(DataOutput out, BDD r) throws IOException { if (r.isOne() || r.isZero()) { ! out.writeBytes("0 0 " + (r.isOne()?1:0) + "\n"); return; } ! out.writeBytes(r.nodeCount() + " " + varNum() + "\n"); for (int x = 0; x < varNum(); x++) ! out.writeBytes(var2Level(x) + " "); ! out.writeBytes("\n"); Map visited = new HashMap(); --- 494,508 ---- // TODO: error code from bdd_save (?) ! public void save(BufferedWriter out, BDD r) throws IOException { if (r.isOne() || r.isZero()) { ! out.write("0 0 " + (r.isOne()?1:0) + "\n"); return; } ! out.write(r.nodeCount() + " " + varNum() + "\n"); for (int x = 0; x < varNum(); x++) ! out.write(var2Level(x) + " "); ! out.write("\n"); Map visited = new HashMap(); *************** *** 517,521 **** } ! protected int save_rec(DataOutput out, Map visited, BDD root) throws IOException { if (root.isZero()) { root.free(); --- 515,519 ---- } ! protected int save_rec(BufferedWriter out, Map visited, BDD root) throws IOException { if (root.isZero()) { root.free(); *************** *** 540,547 **** int hi = save_rec(out, visited, h); ! out.writeBytes(v + " "); ! out.writeBytes(root.var() + " "); ! out.writeBytes(lo + " "); ! out.writeBytes(hi + "\n"); return v; --- 538,545 ---- int hi = save_rec(out, visited, h); ! out.write(v + " "); ! out.write(root.var() + " "); ! out.write(lo + " "); ! out.write(hi + "\n"); return v; Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/org/sf/javabdd/JFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JFactory.java 28 Jul 2004 01:58:06 -0000 1.4 --- JFactory.java 29 Jul 2004 03:43:21 -0000 1.5 *************** *** 12,17 **** import java.util.Random; import java.util.StringTokenizer; ! import java.io.DataInput; ! import java.io.DataOutput; import java.io.IOException; import java.io.PrintStream; --- 12,17 ---- import java.util.Random; import java.util.StringTokenizer; ! import java.io.BufferedReader; ! import java.io.BufferedWriter; import java.io.IOException; import java.io.PrintStream; *************** *** 623,627 **** int[] bddvar2level; /* Variable -> level table */ int[] bddlevel2var; /* Level -> variable table */ ! int bddresized; /* Flag indicating a resize of the nodetable */ int minfreenodes = 20; --- 623,627 ---- int[] bddvar2level; /* Variable -> level table */ int[] bddlevel2var; /* Level -> variable table */ ! boolean bddresized; /* Flag indicating a resize of the nodetable */ int minfreenodes = 20; *************** *** 808,814 **** void checkresize() { ! if (bddresized != 0) bdd_operator_noderesize(); ! bddresized = 0; } --- 808,814 ---- void checkresize() { ! if (bddresized) bdd_operator_noderesize(); ! bddresized = false; } *************** *** 1268,1271 **** --- 1268,1335 ---- } + int relprod_rec(int l, int r) { + BddCacheDataI entry; + int res; + + if (l == 0 || r == 0) + return 0; + if (l == r) + return quant_rec(l); + if (l == 1) + return quant_rec(r); + if (r == 1) + return quant_rec(l); + + int LEVEL_l = LEVEL(l); + int LEVEL_r = LEVEL(r); + if (LEVEL_l > quantlast && LEVEL_r > quantlast) { + int oldop = applyop; + applyop = appexop; + res = apply_rec(l, r); + applyop = oldop; + } else { + entry = BddCache_lookupI(appexcache, APPEXHASH(l, r, appexop)); + if (entry.a == l && entry.b == r && entry.c == appexid) { + if (CACHESTATS) + bddcachestats.opHit++; + return entry.res; + } + if (CACHESTATS) + bddcachestats.opMiss++; + + if (LEVEL_l == LEVEL_r) { + PUSHREF(relprod_rec(LOW(l), LOW(r))); + PUSHREF(relprod_rec(HIGH(l), HIGH(r))); + if (INVARSET(LEVEL_l)) + res = apply_rec(READREF(2), READREF(1)); + else + res = bdd_makenode(LEVEL_l, READREF(2), READREF(1)); + } else if (LEVEL_l < LEVEL_r) { + PUSHREF(relprod_rec(LOW(l), r)); + PUSHREF(relprod_rec(HIGH(l), r)); + if (INVARSET(LEVEL_l)) + res = apply_rec(READREF(2), READREF(1)); + else + res = bdd_makenode(LEVEL_l, READREF(2), READREF(1)); + } else { + PUSHREF(relprod_rec(l, LOW(r))); + PUSHREF(relprod_rec(l, HIGH(r))); + if (INVARSET(LEVEL_r)) + res = apply_rec(READREF(2), READREF(1)); + else + res = bdd_makenode(LEVEL_r, READREF(2), READREF(1)); + } + + POPREF(2); + + entry.a = l; + entry.b = r; + entry.c = appexid; + entry.res = res; + } + + return res; + } + int bdd_relprod(int a, int b, int var) { return bdd_appex(a, b, bddop_and, var); *************** *** 1301,1305 **** if (firstReorder == 0) bdd_disable_reorder(); ! res = appquant_rec(l, r); if (firstReorder == 0) bdd_enable_reorder(); --- 1365,1369 ---- if (firstReorder == 0) bdd_disable_reorder(); ! res = opr == -1 ? relprod_rec(l, r) : appquant_rec(l, r); if (firstReorder == 0) bdd_enable_reorder(); *************** *** 2872,2876 **** bdd_gbc_rehash(); ! bddresized = 1; return 0; --- 2936,2940 ---- bdd_gbc_rehash(); ! bddresized = true; return 0; *************** *** 2890,2894 **** bddnodes = new int[bddnodesize*__node_size]; ! bddresized = 0; for (n = 0; n < bddnodesize; n++) { --- 2954,2958 ---- bddnodes = new int[bddnodesize*__node_size]; ! bddresized = false; for (n = 0; n < bddnodesize; n++) { *************** *** 4291,4297 **** /* (non-Javadoc) ! * @see org.sf.javabdd.BDDFactory#load(java.io.DataInput) */ ! public BDD load(DataInput in) throws IOException { int result = bdd_load(in); return new bdd(result); --- 4355,4361 ---- /* (non-Javadoc) ! * @see org.sf.javabdd.BDDFactory#load(java.io.BufferedReader) */ ! public BDD load(BufferedReader in) throws IOException { int result = bdd_load(in); return new bdd(result); *************** *** 4299,4305 **** /* (non-Javadoc) ! * @see org.sf.javabdd.BDDFactory#save(java.io.DataOutput, org.sf.javabdd.BDD) */ ! public void save(DataOutput out, BDD b) throws IOException { int x = ((bdd) b)._index; bdd_save(out, x); --- 4363,4369 ---- /* (non-Javadoc) ! * @see org.sf.javabdd.BDDFactory#save(java.io.BufferedWriter, org.sf.javabdd.BDD) */ ! public void save(BufferedWriter out, BDD b) throws IOException { int x = ((bdd) b)._index; bdd_save(out, x); *************** *** 5385,5389 **** StringTokenizer tokenizer; ! String readNext(DataInput ifile) throws IOException { while (tokenizer == null || !tokenizer.hasMoreTokens()) { String s = ifile.readLine(); --- 5449,5453 ---- StringTokenizer tokenizer; ! String readNext(BufferedReader ifile) throws IOException { while (tokenizer == null || !tokenizer.hasMoreTokens()) { String s = ifile.readLine(); *************** *** 5395,5399 **** } ! int bdd_load(DataInput ifile) throws IOException { int n, vnum, tmproot; int root; --- 5459,5463 ---- } ! int bdd_load(BufferedReader ifile) throws IOException { int n, vnum, tmproot; int root; *************** *** 5448,5452 **** } ! int bdd_loaddata(DataInput ifile) throws IOException { int key, var, low, high, root = 0, n; --- 5512,5516 ---- } ! int bdd_loaddata(BufferedReader ifile) throws IOException { int key, var, low, high, root = 0, n; *************** *** 5496,5504 **** } ! void bdd_save(DataOutput out, int r) throws IOException { int[] n = new int[1]; if (r < 2) { ! out.writeBytes("0 0 " + r + "\n"); return; } --- 5560,5568 ---- } ! void bdd_save(BufferedWriter out, int r) throws IOException { int[] n = new int[1]; if (r < 2) { ! out.write("0 0 " + r + "\n"); return; } *************** *** 5506,5514 **** bdd_markcount(r, n); bdd_unmark(r); ! out.writeBytes(n[0] + " " + bddvarnum + "\n"); for (int x = 0; x < bddvarnum; x++) ! out.writeBytes(bddvar2level[x] + " "); ! out.writeBytes("\n"); bdd_save_rec(out, r); --- 5570,5578 ---- bdd_markcount(r, n); bdd_unmark(r); ! out.write(n[0] + " " + bddvarnum + "\n"); for (int x = 0; x < bddvarnum; x++) ! out.write(bddvar2level[x] + " "); ! out.write("\n"); bdd_save_rec(out, r); *************** *** 5518,5522 **** } ! void bdd_save_rec(DataOutput out, int root) throws IOException { if (root < 2) --- 5582,5586 ---- } ! void bdd_save_rec(BufferedWriter out, int root) throws IOException { if (root < 2) *************** *** 5530,5537 **** bdd_save_rec(out, HIGH(root)); ! out.writeBytes(root + " "); ! out.writeBytes(bddlevel2var[LEVEL(root)] + " "); ! out.writeBytes(LOW(root) + " "); ! out.writeBytes(HIGH(root) + "\n"); return; --- 5594,5601 ---- bdd_save_rec(out, HIGH(root)); ! out.write(root + " "); ! out.write(bddlevel2var[LEVEL(root)] + " "); ! out.write(LOW(root) + " "); ! out.write(HIGH(root) + "\n"); return; |
From: John W. <joe...@us...> - 2004-07-28 11:56:17
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29024 Modified Files: project.properties Log Message: Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** project.properties 25 Jul 2004 10:44:09 -0000 1.3 --- project.properties 28 Jul 2004 11:56:07 -0000 1.4 *************** *** 15,18 **** --- 15,22 ---- #maven.xdoc.poweredby.url = http://sourceforge.net/projects/javabdd + # Show the last updated date on the web page. + maven.xdoc.date = left + maven.xdoc.date.format = MMMM dd yyyy HH:mm z + # Properties for compiling JNI. maven.native.src = . |
From: John W. <joe...@us...> - 2004-07-28 11:38:20
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26934 Modified Files: Makefile project.xml cal_jni.c Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/Makefile,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Makefile 28 Jul 2004 10:25:55 -0000 1.25 --- Makefile 28 Jul 2004 11:38:08 -0000 1.26 *************** *** 52,56 **** JDK_ROOT = $(firstword $(wildcard /usr/java/j2sdk*)) CLASSPATH = .:jdd.jar ! CFLAGS = -D_REENTRANT -D_GNU_SOURCE -O2 $(EXTRA_CFLAGS) CAL_CFLAGS = -O2 -DCLOCK_RESOLUTION=60 -DRLIMIT_DATA_DEFAULT=16777216 -DNDEBUG=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_ASSERT_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_PWD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_STDARG_H=1 -DHAVE_VARARGS_H=1 -DSIZEOF_VOID_P=4 -DSIZEOF_INT=4 -DHAVE_IEEE_754=1 -DPAGE_SIZE=4096 -DLG_PAGE_SIZE=12 -DRETSIGTYPE=void -DHAVE_STRCOLL=1 -DHAVE_SYSCONF=1 -DHAVE_GETHOSTNAME=1 -DHAVE_STRCSPN=1 -DHAVE_STRERROR=1 -DHAVE_STRSPN=1 -DHAVE_STRSTR=1 -DHAVE_GETENV=1 -DHAVE_STRCHR=1 -DHAVE_GETRLIMIT=1 -DHAVE_GETRUSAGE=1 -DHAVE_VALLOC=1 $(EXTRA_CFLAGS) OBJECT_OUTPUT_OPTION = -o$(space) --- 52,56 ---- JDK_ROOT = $(firstword $(wildcard /usr/java/j2sdk*)) CLASSPATH = .:jdd.jar ! CFLAGS = -O2 $(EXTRA_CFLAGS) CAL_CFLAGS = -O2 -DCLOCK_RESOLUTION=60 -DRLIMIT_DATA_DEFAULT=16777216 -DNDEBUG=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_ASSERT_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_PWD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_STDARG_H=1 -DHAVE_VARARGS_H=1 -DSIZEOF_VOID_P=4 -DSIZEOF_INT=4 -DHAVE_IEEE_754=1 -DPAGE_SIZE=4096 -DLG_PAGE_SIZE=12 -DRETSIGTYPE=void -DHAVE_STRCOLL=1 -DHAVE_SYSCONF=1 -DHAVE_GETHOSTNAME=1 -DHAVE_STRCSPN=1 -DHAVE_STRERROR=1 -DHAVE_STRSPN=1 -DHAVE_STRSTR=1 -DHAVE_GETENV=1 -DHAVE_STRCHR=1 -DHAVE_GETRLIMIT=1 -DHAVE_GETRUSAGE=1 -DHAVE_VALLOC=1 $(EXTRA_CFLAGS) OBJECT_OUTPUT_OPTION = -o$(space) *************** *** 68,73 **** CAL_DLL_NAME = libcal.so ifeq (${CC},icc) # Intel Linux compiler ! CFLAGS = -D_REENTRANT -D_GNU_SOURCE -O2 -Ob2 -ip $(EXTRA_CFLAGS) ! LINKFLAGS = -shared -static-libcxa endif endif --- 68,74 ---- CAL_DLL_NAME = libcal.so ifeq (${CC},icc) # Intel Linux compiler ! CFLAGS = -O2 -Ob2 -ip $(EXTRA_CFLAGS) ! LINK = icc ! LINKFLAGS = -shared $(EXTRA_CFLAGS) endif endif *************** *** 121,125 **** $(BUDDY_SRC)/cache.c $(BUDDY_SRC)/fdd.c $(BUDDY_SRC)/imatrix.c \ $(BUDDY_SRC)/kernel.c $(BUDDY_SRC)/pairs.c $(BUDDY_SRC)/prime.c \ ! $(BUDDY_SRC)/reorder.c $(BUDDY_SRC)/tree.c BUDDY_OBJS = $(BUDDY_SRCS:.c=.o) --- 122,126 ---- $(BUDDY_SRC)/cache.c $(BUDDY_SRC)/fdd.c $(BUDDY_SRC)/imatrix.c \ $(BUDDY_SRC)/kernel.c $(BUDDY_SRC)/pairs.c $(BUDDY_SRC)/prime.c \ ! $(BUDDY_SRC)/reorder.c $(BUDDY_SRC)/tree.c $(BUDDY_SRC)/trace.c BUDDY_OBJS = $(BUDDY_SRCS:.c=.o) Index: cal_jni.c =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/cal_jni.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cal_jni.c 1 Dec 2003 04:07:10 -0000 1.1 --- cal_jni.c 28 Jul 2004 11:38:08 -0000 1.2 *************** *** 128,134 **** m = manager; manager = NULL; // race condition with delRef - printf("Calling Cal_BddManagerQuit(%x)...\n", m); Cal_BddManagerQuit(m); - printf("done.\n"); } --- 128,132 ---- *************** *** 499,506 **** { Cal_Bdd d; d = (Cal_Bdd) (intptr_cast_type) a; ! printf("satCount not implemented.\n"); ! //return Cudd_CountMinterm(manager, d, varcount); ! return 0; } --- 497,505 ---- { Cal_Bdd d; + double result = 1.0; + int k = Cal_BddVars(manager); + while (--k >= 0) result *= 2.0; d = (Cal_Bdd) (intptr_cast_type) a; ! return Cal_BddSatisfyingFraction(manager, d) * result; } Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** project.xml 27 Jul 2004 23:01:23 -0000 1.6 --- project.xml 28 Jul 2004 11:38:08 -0000 1.7 *************** *** 175,194 **** <sourceDirectory>.</sourceDirectory> ! <!-- TODO ! <unitTestSourceDirectory>src/test</unitTestSourceDirectory> <aspectSourceDirectory/> - --> <!-- Unit test cases --> - <!-- TODO <unitTest> <includes> <include>**/*Test.java</include> </includes> <excludes> <exclude>**/RepositoryTest.java</exclude> </excludes> - </unitTest> --> <!-- J A R R E S O U R C E S --> --- 175,195 ---- <sourceDirectory>.</sourceDirectory> ! <unitTestSourceDirectory>../JavaBDD_tests</unitTestSourceDirectory> <aspectSourceDirectory/> <!-- Unit test cases --> <unitTest> <includes> <include>**/*Test.java</include> </includes> + <includes> + <include>regression/*.java</include> + </includes> + <!-- Not currently used. <excludes> <exclude>**/RepositoryTest.java</exclude> </excludes> --> + </unitTest> <!-- J A R R E S O U R C E S --> |
From: John W. <joe...@us...> - 2004-07-28 10:26:05
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16460 Modified Files: Makefile Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/Makefile,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Makefile 28 Jul 2004 07:47:12 -0000 1.24 --- Makefile 28 Jul 2004 10:25:55 -0000 1.25 *************** *** 91,95 **** org/sf/javabdd/CUDDFactory.java \ org/sf/javabdd/FindBestOrder.java \ ! org/sf/javabdd/JavaFactory.java \ org/sf/javabdd/JDDFactory.java \ org/sf/javabdd/TestBDDFactory.java \ --- 91,95 ---- org/sf/javabdd/CUDDFactory.java \ org/sf/javabdd/FindBestOrder.java \ ! org/sf/javabdd/JFactory.java \ org/sf/javabdd/JDDFactory.java \ org/sf/javabdd/TestBDDFactory.java \ |
From: John W. <joe...@us...> - 2004-07-28 10:21:04
|
Update of /cvsroot/javabdd/JavaBDD_tests/regression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15848/regression Modified Files: R2.java R1.java Log Message: Updates. Index: R1.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/regression/R1.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** R1.java 28 Jul 2004 09:38:34 -0000 1.2 --- R1.java 28 Jul 2004 10:20:53 -0000 1.3 *************** *** 5,12 **** import junit.framework.Assert; - import junit.framework.TestCase; import org.sf.javabdd.BDD; import org.sf.javabdd.BDDDomain; import org.sf.javabdd.BDDFactory; /** --- 5,12 ---- import junit.framework.Assert; import org.sf.javabdd.BDD; import org.sf.javabdd.BDDDomain; import org.sf.javabdd.BDDFactory; + import bdd.BDDTestCase; /** *************** *** 16,20 **** * @version $Id$ */ ! public class R1 extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(R1.class); --- 16,20 ---- * @version $Id$ */ ! public class R1 extends BDDTestCase { public static void main(String[] args) { junit.textui.TestRunner.run(R1.class); *************** *** 22,35 **** public void testR1() { ! BDDFactory bdd = BDDFactory.init(1000, 1000); ! BDDDomain d = bdd.extDomain(new int[] { 16 })[0]; ! BDD x = d.ithVar(6).orWith(d.ithVar(13)); ! BDD set = d.set(); ! double s1 = x.satCount(set); ! bdd.setVarNum(20); ! double s2 = x.satCount(set); ! Assert.assertEquals(s1, s2, 0.00001); ! x.free(); set.free(); ! bdd.done(); } } --- 22,36 ---- public void testR1() { ! while (hasNext()) { ! BDDFactory bdd = nextFactory(); ! BDDDomain d = bdd.extDomain(new int[] { 16 })[0]; ! BDD x = d.ithVar(6).orWith(d.ithVar(13)); ! BDD set = d.set(); ! double s1 = x.satCount(set); ! bdd.setVarNum(20); ! double s2 = x.satCount(set); ! Assert.assertEquals(bdd.toString(), s1, s2, 0.00001); ! x.free(); set.free(); ! } } } Index: R2.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/regression/R2.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** R2.java 28 Jul 2004 09:58:21 -0000 1.1 --- R2.java 28 Jul 2004 10:20:53 -0000 1.2 *************** *** 4,12 **** package regression; import org.sf.javabdd.BDD; - import org.sf.javabdd.BDDDomain; import org.sf.javabdd.BDDFactory; ! import junit.framework.Assert; ! import junit.framework.TestCase; /** --- 4,11 ---- package regression; + import junit.framework.Assert; import org.sf.javabdd.BDD; import org.sf.javabdd.BDDFactory; ! import bdd.BDDTestCase; /** *************** *** 16,20 **** * @version $Id$ */ ! public class R2 extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(R2.class); --- 15,19 ---- * @version $Id$ */ ! public class R2 extends BDDTestCase { public static void main(String[] args) { junit.textui.TestRunner.run(R2.class); *************** *** 22,35 **** public void testR2() { ! BDDFactory bdd = BDDFactory.init(1000, 1000); ! BDD zero = bdd.zero(); ! BDD one = bdd.one(); ! Assert.assertTrue(zero.isZero()); ! Assert.assertTrue(one.isOne()); ! BDD s0 = zero.support(); ! BDD s1 = one.support(); ! Assert.assertTrue(s0.isOne()); ! Assert.assertTrue(s1.isOne()); ! bdd.done(); } } --- 21,37 ---- public void testR2() { ! while (hasNext()) { ! BDDFactory bdd = nextFactory(); ! BDD zero = bdd.zero(); ! BDD one = bdd.one(); ! Assert.assertTrue(bdd.toString(), zero.isZero()); ! Assert.assertTrue(bdd.toString(), one.isOne()); ! BDD s0 = zero.support(); ! BDD s1 = one.support(); ! Assert.assertTrue(bdd.toString(), s0.isOne()); ! Assert.assertTrue(bdd.toString(), s1.isOne()); ! zero.free(); one.free(); ! s0.free(); s1.free(); ! } } } |