Enable bounded cross-multiplication of inequations in DefOps#3907
Merged
Conversation
wadoon
approved these changes
Jul 14, 2026
Created with AI tooling support
unp1
force-pushed
the
bubel/defops-crossmult
branch
from
July 15, 2026 07:47
e35ce0b to
d6e62e2
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intended Change
A regularly occuring problem (at least in my case) is that KeY could not close a proof on DefOps and I had to switch to Model Search which closed it.
What closed the problem at the end was the use of the cross multiplication not the systematic suts or equation saturation performed by Model Search.
An example that could not be proven w/o switching to Model Search is
The reason why cross multiplication handling was not on DefOps is that it could drown out other theories. This PR activates cross-multiplication in a restricted form for DefOps. The cross multiplication rules are restricted to cases where the product of the left-hand sides of the involved inequations occurs on some other inequation on the left side too.
Type of pull request
Ensuring quality
DefOpsCrossMultiplicationTestwith the pure arithmeticcore of the matrix obligation (
crossMultDefOps.key): closes with DefOps(new) and with Model Search (as before), stays open with Basic.
runAllProofson the branch: 674/674 proofs, 0 failures.node counts).
(189 entries) was proven with and without this change; all 180 closing proofs
come out node-for-node identical, none changes its provable/unprovable
outcome. Cross-multiplication fires in none of them — the exactly-bounded
restriction admits it only where it is actually needed, so the existing proof
search is untouched and only the previously unprovable obligations gain.
inequation-dense DefOps examples: it is skipped entirely (zero evaluations) on
six of them, because the cheap monomial/polynomial filters reject before the
check runs. The heaviest example in the corpus
(
standard_key/arith/gemplusDecimal/add.key) performs 0.76 evaluations perproof node at roughly 4 µs each, i.e. about 1% of its automode time — below
the run-to-run spread of the unmodified prover on the same example (~10%).
machinery, which the multi-core prover shares between goals):
FeatureStatelessnessLintTestandSharedStateLintTestpass withoutallowlist entries;
testMt2w(single-core reproducibility gateScDeterminismTest+ 2-worker corpus),testMt4w, and the parallel-proverdeterminism/equivalence tests all pass. No mutable state is added: the
bounding features are stateless and their term buffers keep their values in
the per-evaluation
MutableState.Additional information and contact(s)
The strategy-side surface of this PR (per-mode bindings in
IntegerStrategy)overlaps with the value-preserving cost refactoring in #3904; whichever lands
second needs a small mechanical rebase there.
PR created with AI tooling support.
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.