Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug, rational produced where an integer is expected. #32

Closed
wintersteiger opened this issue Apr 9, 2015 · 3 comments
Closed

Bug, rational produced where an integer is expected. #32

wintersteiger opened this issue Apr 9, 2015 · 3 comments

Comments

@wintersteiger
Copy link
Contributor

Malte Schwerhoff has previously reported a bug on stackoverflow:

http://stackoverflow.com/questions/28088487/unexpected-error-message-reproduction-apparently-very-fragile-bug

Internally a rational is produced where an integer is expected.

@Drup
Copy link
Contributor

Drup commented Apr 10, 2015

I also saw a similar problem, and for me it was usually an issue of promotion between heterogeneous operands. for i and r integers and rational, r + i was a rational and i + r an integer, or something like that.

I just added manual promotions everywhere and rolled with it.

edit: rationals, not floats.

@wintersteiger
Copy link
Contributor Author

I can't reproduce this problem with the latest unstable branch anymore, but I suspect the problem is just hidden now, because this file is significantly faster (and with less unknowns) than before. Does either of you still see this problem?

@NikolajBjorner
Copy link
Contributor

Issue fix for #161 deals with the case where the arithmetic solver returns l_undef (due to for example non-linear arithmetic). In this case models could still be extracted even though no assurance that the model would satisfy the formula. To ensure that integers are returned during this model construction phase, the arithmetic module truncates non-integer solutions to integer variables. It is reasonable to assume this is the core of also this issue.

NikolajBjorner added a commit to NikolajBjorner/z3 that referenced this issue Oct 21, 2016
* local changes

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add bound extraction for variables

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* adding fixed equality propagation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* adding fixed equality propagation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* adding fixed equality propagation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* adding bounds propagation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add eager bounds propagation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add configuration parameters for LP solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants