Skip to content

Mirror bvugt/bvuge/bvsgt/bvsge onto bvult/bvule/bvslt/bvsle - #799

Open
the-mr-dave wants to merge 3 commits into
devfrom
wip/rvde/mirror-greater-comparisons
Open

Mirror bvugt/bvuge/bvsgt/bvsge onto bvult/bvule/bvslt/bvsle#799
the-mr-dave wants to merge 3 commits into
devfrom
wip/rvde/mirror-greater-comparisons

Conversation

@the-mr-dave

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite the four "greater than" bitvector comparisons into their swapped
    "less than" counterpart (e.g. (bvugt a b) -> (bvult b a)) instead of
    implementing constant folding separately for both directions.
  • Halves the number of comparison operators that need their own normal
    form / constant-folding implementation.
  • Add tests covering each mirrored comparison plus two guards confirming
    constant folding still triggers correctly after the operand swap.

@rvinton
rvinton marked this pull request as ready for review August 18, 2026 08:35
@rvinton
rvinton requested a review from Heizmann August 18, 2026 08:35
@the-mr-dave
the-mr-dave force-pushed the wip/rvde/mirror-greater-comparisons branch from c8426d0 to 4c82a22 Compare August 26, 2026 10:21

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are here

the-mr-dave and others added 3 commits August 31, 2026 00:20
Rewrites the four "greater than" comparisons into their swapped "less
than" counterpart instead of implementing constant folding for both
directions separately, e.g. (bvugt a b) -> (bvult b a). Halves the
number of comparison operators that need their own normal form.

Co-authored-by: rvinton <rvinton@users.noreply.github.com>
Covers each of the four "greater than" comparisons being swapped into
its "less than" counterpart, plus two guards confirming that constant
folding still triggers correctly after the operand swap instead of
just rewriting the operator syntactically.

Co-authored-by: rvinton <rvinton@users.noreply.github.com>
Uses runUnfTest (UnfTransformer directly) instead of
SimplificationTest.runSimplificationTest, matching the workflow already
used for the other UnfTransformer-level tests in this class.

Co-authored-by: rvinton <rvinton@users.noreply.github.com>
@the-mr-dave
the-mr-dave force-pushed the wip/rvde/mirror-greater-comparisons branch from 1832c2e to c677116 Compare August 30, 2026 22:31
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.

2 participants