Thread: [Javabdd-devel] Ranges
Brought to you by:
joewhaley
From: Ricardo O. <n3...@ho...> - 2008-07-28 19:26:26
|
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 |
From: Ricardo O. <n3...@ho...> - 2008-07-28 21:37:27
|
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 |
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 > |
From: Ricardo O. <n3...@ho...> - 2008-07-30 03:39:53
|
Hi, I tried a few more things, but couldn't figure out why it could be doing this. I didn't check your code, though. I wrote a small wrapper to handle ranges. It only determines the correct BDD for a range, by removing the extra part that the varRange() method adds at the beginning (basic set difference). It seems to be enough for now, but I'm still not very sure because sometimes varRange() seems to work correctly.. Hope you have more time than me to check this out. Ricardo. Date: Mon, 28 Jul 2008 22:33:43 -0700From: joe...@gm...To: n3...@ho...Subject: Re: [Javabdd-devel] RangesCC: jav...@li... 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 00 0 0 10 0 1 00 0 1 1So, 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 - 00 1 0 0 - 41 0 0 0 - 81 1 0 0 - 120 0 1 0 - 21 0 1 0 - 100 1 1 0 - 60 0 0 1 - 10 0 1 1 - 31 0 0 1 - 91 0 1 1 - 110 1 0 1 - 50 1 1 1 - 7Is 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 Vistahttp://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 challengeBuild the coolest Linux based applications with Moblin SDK & win great prizesGrand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________Javabdd-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/javabdd-devel _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx |
From: Ricardo O. <n3...@ho...> - 2008-07-31 03:53:43
|
Hi, One more issue. I'm beginning to find this very strange. The following code: BDDDomain domain = bddFactory.extDomain(65535); BDD rule = domain.varRange(0, 4000); rule.allsat(); gives the following result: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 60 at net.sf.javabdd.BuDDyFactory$BuDDyBDD.allsat0(Native Method) at net.sf.javabdd.BuDDyFactory$BuDDyBDD.allsat(BuDDyFactory.java:889) Is this normal? Am I doing something wrong? Thanks, Ricardo. ________________________________ From: n3...@ho... To: jw...@al... Date: Wed, 30 Jul 2008 03:39:46 +0000 CC: jav...@li... Subject: Re: [Javabdd-devel] Ranges Hi, I tried a few more things, but couldn't figure out why it could be doing this. I didn't check your code, though. I wrote a small wrapper to handle ranges. It only determines the correct BDD for a range, by removing the extra part that the varRange() method adds at the beginning (basic set difference). It seems to be enough for now, but I'm still not very sure because sometimes varRange() seems to work correctly.. Hope you have more time than me to check this out. Ricardo. ________________________________ Date: Mon, 28 Jul 2008 22:33:43 -0700 From: joe...@gm... To: n3...@ho... Subject: Re: [Javabdd-devel] Ranges CC: jav...@li... 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 ________________________________ Get news, entertainment and everything you care about at Live.com. Check it out! _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE |