Improve qe-light elimination for BV vars constrained by constant (dis)equalities#9359
Draft
Copilot wants to merge 3 commits into
Draft
Improve qe-light elimination for BV vars constrained by constant (dis)equalities#9359Copilot wants to merge 3 commits into
qe-light elimination for BV vars constrained by constant (dis)equalities#9359Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/53219443-a721-4e6d-a7c3-21a6387b3396 Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/53219443-a721-4e6d-a7c3-21a6387b3396 Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix performance issue with apply qe in BV formula
Improve Apr 21, 2026
qe-light elimination for BV vars constrained by constant (dis)equalities
| if (!bv.is_bv_sort(var_sort)) | ||
| return false; | ||
| obj_hashtable<expr> values; | ||
| if (!collect_bv_eq_constants(body, i, values) || values.empty()) |
Contributor
There was a problem hiding this comment.
this fails fast instead of handling bit-vector variables that satisfy the conditions
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.
apply qeon a small BV existential formula could stall in practice, while the same shape is easy to simplify by case analysis on a small set of constant comparisons. This change teachesqe-lightto recognize and eliminate that pattern directly.BV case-split expansion in
qe-lightsrc/qe/lite/qe_lite_tactic.cppfor quantified BV variables that occur only in equalities with constants (including under negation).Integration point
eq_der/FM quantifier reduction path, as a fallback alongside existing bounded-expansion logic.Regression coverage
src/test/qe_arith.cppusing a minimized BV formula with the same structural pattern as the reported repro.qe_liteif (m_imp.try_expand_bounded_quantifier(q, result, expanded) || m_imp.try_expand_bv_eq_quantifier(q, result, expanded)) { ... }