[BUG] Bounds are not checked on variable definition
See original GitHub issueDescribe the bug The lower and upper bounds are not checked on variable definition.
To Reproduce Define a variable with invalid bounds.
m.intVar( 2 * IntVar.MIN_INT_BOUND, 2 * IntVar.MAX_INT_BOUND);
Expected behavior
I am unsure, but the behavior should depend on the nature of the variable : decision or auxiliary.
- One can ask the user to bound decision variables.
- However, auxiliary variables can be assigned large values even in a small search space. It is the case for a product or power constraints, or more generally arithmetic expressions.
For now, the practical issue is that the behavior is hard to predict. Some later checks can raise an exception, or not, when building a model with arithmetic expressions.
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Bounds checking - Wikipedia
In computer programming, bounds checking is any method of detecting whether a variable is within some bounds before it is used. It is...
Read more >Variable bounds are not checked when the variables are not ...
@jsiirola - I'm going through old bug reports. Is this bug still present in the most recent Pyomo version?
Read more >No out of bounds error - Stack Overflow
When you access an array index, C and C++ don't do bound checking. ... is on the stack, next to other variables, so...
Read more >Bounds Checking - LRDE
Unchecked objects Variables declared in files that are not compiled with -fbounds-checking are not normally known about by the checking library. Pointers that ......
Read more >Instrumentation Options - GCC, the GNU Compiler Collection
This option instructs the compiler to check that the size of a variable length array is positive. -fsanitize=null. This option enables pointer checking....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this looks good to me, but if it is a log and not an exception, maybe we can even use if max > IntVar.MaxIntBound.
Another proposal: