Skip to content

Add some more bitvector operations (rotations and extensions)#54

Merged
fitzgen merged 1 commit intoelliottt:mainfrom
travitch:non-standard-bv-ops
Feb 3, 2026
Merged

Add some more bitvector operations (rotations and extensions)#54
fitzgen merged 1 commit intoelliottt:mainfrom
travitch:non-standard-bv-ops

Conversation

@travitch
Copy link
Copy Markdown
Contributor

This change includes zero_extend, sign_extend, rotate_left, and rotate_right. These seem to be non-standard (i.e., are not in SMTLib2), but are widely supported in solvers.

@travitch travitch force-pushed the non-standard-bv-ops branch from 6223878 to 884956f Compare February 1, 2026 02:19
@travitch
Copy link
Copy Markdown
Contributor Author

travitch commented Feb 1, 2026

Note: I updated the PR from the initial version to also include bvnor

Copy link
Copy Markdown
Collaborator

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Can you add doc comments that warn that these are part of a non-standard SMTLIB2 language extension and are supported in many solvers, but not all? Thanks

This change includes `bvnor`, `zero_extend`, `sign_extend`, `rotate_left`, and `rotate_right`.
@travitch travitch force-pushed the non-standard-bv-ops branch from 884956f to 96bab60 Compare February 3, 2026 05:13
@travitch
Copy link
Copy Markdown
Contributor Author

travitch commented Feb 3, 2026

I was revising to document, then I discovered that they are actually documented in the standard. For some reason they do not appear in the FixedSizeBitVectors theory, but are defined in the QF_BV logic.

After reading through that I updated the commit message and updated the rotation operation definitions to only accept non-negative rotation amounts, consistent with the standard.

Copy link
Copy Markdown
Collaborator

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Thanks!

@fitzgen fitzgen merged commit dac72a4 into elliottt:main Feb 3, 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.

2 participants