Fix eqModACRect renaming check and Injectivity success_3 expectation - #890
Merged
Merged
Conversation
eqModAC_ returned early on syntactically identical subterms without checking them against the renaming it was building up, so two clauses that shared a subterm could compare equal even when no consistent renaming existed. success_3 in tInferences_HOL_Injectivity relied on that. Its expected clause was copied from success_2, which inverts the first argument of f, but its input makes f injective in the second. Which clause Injectivity derives depends on argument evaluation order, because equality arguments are normalised by term id: clang puts f(X0,X2) on the lhs and derives inv(X0, f(X0,X2)) = X2, which shares f(X0,X2) with the expectation and short-circuits. gcc puts f(X0,X1) there, derives inv(X0, f(X0,X1)) = X1, and fails. Also fixes the TermList overload of eqModACRect collecting vr from lhs. Closes vprover#889
mezpusz
approved these changes
Jul 29, 2026
mezpusz
left a comment
Contributor
There was a problem hiding this comment.
The tests are seemingly not slowed down by the removed check, so I approve. Thanks for the fix!
Contributor
|
This should also fix the coverage build, rerunning now 🤞 https://github.com/vprover/vampire/actions/runs/30460258799 |
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.
Fixes #889.
TestUtils::eqModAC_opened withOn shared terms that is pointer equality, and it returned without recording the variable renaming, so
eqModACRectaccepted clause pairs that are not equal up to renaming whenever the two happened to share a subterm.success_3intInferences_HOL_Injectivitywas riding on that. Its input makesfinjective in its second argument, so the left inverse isinv(x, f(x,z)) = z, but the expectation was copied fromsuccess_2and saysinv(z, f(x,z)) = x. Which clauseInjectivityderives depends on the evaluation order of the two operands of!=, because equality arguments are normalised by term id. clang derivesinv(X0, f(X0,X2)) = X2, which sharesf(X0,X2)with the expectation and short-circuits, so CI stayed green. gcc derivesinv(X0, f(X0,X1)) = X1, and the test fails.Three changes:
eqModAC_.success_3expectation.TermListoverload ofeqModACRect, which collectedvrfromlhsand so comparedlhsagainst itself in its variable count guard. Nothing in the suite goes through that overload, so it is a separate bug I noticed while reading rather than something this PR needed.Checked with gcc 15.2, Debug: 97/97 in about 20s, unchanged from before, so no other test was relying on the fast path.
With the fast path gone the old expectation also fails under clang's ordering. I reproduced that ordering under gcc by swapping the written order of the two operands, which builds the same clause but reverses the creation order:
Disclosure: I used AI to generate this PR text. The code has been wrote by myself.