Re: [Javabdd-devel] Ranges
Brought to you by:
joewhaley
From: John W. <joe...@gm...> - 2008-07-29 05:33:46
|
I think the varRange implementation could be making assumptions about the BDD variable ordering, leading to weird behavior. If you manage to track down the issue, let me know. -John On Mon, Jul 28, 2008 at 2:37 PM, Ricardo Oliveira <n3...@ho...> wrote: > > Hi again, > > I have another issue related to ranges. It seems that there's something odd > happening when I select ranges with some values. So for instance, if I ask > for a range to the following values: > > BDDDomain domain = bddFactory.extDomain(16); > BDD bdd = domain.varRange(2, 3); > bdd.printSet(); > > I get: > > > > Which means that the possible values are from 0 to 3 and not from 2 to 3: > > 0 0 0 0 > 0 0 0 1 > 0 0 1 0 > 0 0 1 1 > > So, I tried from 10 to 12 and got the strange values: > > > > which represent the interval 8 to 12. > To test it further, I tried with 11 to 12 and got the exact same set: > > > > It seems that this is making the range from the closest 8 bit partition(?) > or whatever to the value you say. This means that any range between 0 and 16 > that you ask will always be between 0 or 8 (according to the lowest bit) and > the upper value you give it. > > Here's the output for range 2 to 12: > > > > 0 0 0 0 - 0 > 0 1 0 0 - 4 > 1 0 0 0 - 8 > 1 1 0 0 - 12 > 0 0 1 0 - 2 > 1 0 1 0 - 10 > 0 1 1 0 - 6 > 0 0 0 1 - 1 > 0 0 1 1 - 3 > 1 0 0 1 - 9 > 1 0 1 1 - 11 > 0 1 0 1 - 5 > 0 1 1 1 - 7 > > Is this the expected behavior? > > Thank you, > Ricardo. > > > > From: n3...@ho... > > To: jav...@li... > > Date: Mon, 28 Jul 2008 19:26:20 +0000 > > Subject: [Javabdd-devel] Ranges > > > > > > > > Hi, > > > > I'm having problem using the varRange() method of BDDDomain. > > > > If I create BDDDomain with these sizes: > > > > long sizes[] = new long[] {65535, 65535}; > > BDDDomain[] domain= bddFactory.extDomain(sizes); > > > > Every time I try to create a range for the maximum values (which should > be inclusive): > > > > BDD bdd = domain[0].varRange(0, 65535); > > > > I get the following error: > > > > Exception in thread "main" net.sf.javabdd.BDDException: range is invalid > > at net.sf.javabdd.BDDDomain.varRange(BDDDomain.java:253) > > at net.sf.javabdd.BDDDomain.varRange(BDDDomain.java:249) > > > > If I try with: > > > > long sizes[] = new long[] {65536, 65536}; > > BDDDomain[] domain= bddFactory.extDomain(sizes); > > > > I get: > > > > Exception in thread "main" java.lang.ArithmeticException: Negative bit > address > > at java.math.BigInteger.testBit(Unknown Source) > > at net.sf.javabdd.BDDDomain.varRange(BDDDomain.java:262) > > at net.sf.javabdd.BDDDomain.varRange(BDDDomain.java:249) > > > > One solution is using one extra bit (increasing the size to 65535*2), but > I was really hoping this wouldn't be necessary. Perhaps I'm doing something > incredibly stupid, but I can't see what at this point. > > > > Thank you very much for your help, > > Ricardo. > > _________________________________________________________________ > > Invite your mail contacts to join your friends list with Windows Live > Spaces. It's easy! > > > http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Javabdd-devel mailing list > > Jav...@li... > > https://lists.sourceforge.net/lists/listinfo/javabdd-devel > > _________________________________________________________________ > Discover the new Windows Vista > http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Javabdd-devel mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javabdd-devel > |