-
Notifications
You must be signed in to change notification settings - Fork 52
Z3 fails when given mixed integer-real arguments for division #461
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
Comments
I've written some more tests and mixed real-integer terms seem to be broken on other solvers as well: In most of these cases the return type is wrong and operations like |
There is nothing wrong with returning We can insert type-conversion inside of the |
I agree, but this assumes that the solver can somehow handle the conversions internally. For Z3 this seems to mostly work (with the exception of
will crash on SMTInterpol, Princess and CVC5. SMTInterpol and Princess fail in On Z3 there is no crash, but the types don't match:
This code will print |
Hello everyone,
there seems to be an issue with division in Z3 if one of the arguments is integer and the other is real:
The output while running the test for Z3 looks like this:
Depending on the type of the first argument Z3 seems to be using either integer or rational division. The result for
f1
on Z3 is therefore0
and not1/2
as expected. We should add some explicit casts to make sure that rational division is always used when either of the arguments is rational.I did check the other operations in
NumeralFormulaManager
and this bug only seems to affect division.The text was updated successfully, but these errors were encountered: