Wednesday, March 19, 2008

New Labels

To be consistent with the name of this blog that embraces a filesystem naming style, I am introducing the following labels for my posts.

/dev/random, replaces "code", which is inspired by the homonymous column in the USENIX magazine ;login:.

/media, replaces "movies" and "music" for entertainment.

/mnt, for mount points, replaces "travel". Of course it includes trips more than those to mountains.

/usr/X11R7, where the X Window System resides, replaces "photos". When will it be replaced by "/usr/X11R8"?

/var, replaces "uncategorized" for scribblings, e.g., the current post.

Sunday, March 02, 2008

Small Patch for bddbddb

Here's a small bug for bddbddb. If there is a small sized domain (e.g., only 2 functions in the Domain F), and some constant strings in a Datalog file (e.g., 4 additional function names used in the rules), the resulting size of the domain will be out of range (e.g., the size of F is 6 rather than 2, which requires a different bit size) and an exception is raised (e.g., Exception in thread "main" net.sf.javabdd.BDDException: 6 is out of range).

Usually this doesn't hurt because the size of a domain is large enough and it's unlikely to cross the boundary of the BDD size. Though it would fail to compute a call graph for a simple hello-world program.

A possible patch for the method namedConstant in net/sf/bddbddb/Domain.java.
Index: Domain.java
===================================================================
--- Domain.java (revision 654)
+++ Domain.java (working copy)
@@ -114,6 +114,8 @@
if (false && map == null) throw new
IllegalArgumentException("No constant map for Domain " + name + " in
which to look up constant " + constant);
if (map == null) map = new IndexMap(name);
if (!map.contains(constant)) System.err.println("Warning:
Constant " + constant + " not found in map for relation " + name);
- return map.get(constant);
+ int index = map.get(constant);
+ size = BigInteger.valueOf(index + 1L).max(size);
+ return index;
}
}