Skip to content

Fix Z3 Euclidean division for rationals and reals - #1025

Merged
quickbeam123 merged 1 commit into
vprover:masterfrom
shalashaska117:fix-issue-994
Oct 20, 2026
Merged

quickbeam123 merged 1 commit into
vprover:masterfrom
shalashaska117:fix-issue-994

Conversation

@shalashaska117

Copy link
Copy Markdown
Contributor

Closes #994.

The Z3 backend translates rational and real $quotient_e as ordinary division, which can refute satisfiable inputs. Round down for positive divisors and up for negative divisors; $remainder_e then uses the corrected quotient. Keep zero-divisor results uninterpreted and declare the auxiliary functions in exported problems.

Checks:

  • All 103 Debug CTest groups and the Release sanity suite pass.
  • New unit regressions cover both fractional sorts, operand signs, exact division, zero dividends and divisors, plus integer controls. The rational and real regressions fail on master.
  • A 32-case CLI matrix in Debug and Release removes all 16 false refutations and refutes all 16 unsatisfiable controls. The satisfiable CLI cases return GaveUp; the direct Z3 unit tests return SAT.

Round the quotient according to the divisor sign so that the remainder
is nonnegative. Keep division by zero uninterpreted and declare its
auxiliary functions when exporting to SMT-LIB or Z3 API calls.

Add satisfiable and unsatisfiable unit checks for fractional operands,
sign combinations, exact division and zero divisors, with integer controls.

Closes vprover#994
@quickbeam123
quickbeam123 merged commit b0fd490 into vprover:master Oct 20, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

Z3 translation gives false refutations for rational and real Euclidean division

2 participants