Skip to content

Conversation

@mark14wu
Copy link
Collaborator

@mark14wu mark14wu commented Oct 3, 2025

Add boolean conversion for Z3 bitwise operations to ensure correct evaluation when operands are numeric values rather than boolean references.

Before:
lhs: 0 != 789961280 + (pid_0*1024 + arange_0)*8
rhs: 1

After:
lhs: 0 != 789961280 + (pid_0*1024 + arange_0)*8
rhs: 1 != 0

…ean conversion

Add boolean conversion for Z3 bitwise operations to ensure correct evaluation when operands are numeric values rather than boolean references.
@mark14wu mark14wu marked this pull request as ready for review October 3, 2025 15:45
@mark14wu
Copy link
Collaborator Author

mark14wu commented Oct 3, 2025

Fixes #154.

if self.op == "bitwise_and":
self._z3 = And(lhs, rhs)
if "bitwise" in self.op:
lhs = _to_bool(lhs)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the logic of to_bool.

You should probably look into BitVec in Z3

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.

3 participants