Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create z3_pass #36

Merged
merged 3 commits into from
Jul 19, 2024
Merged

feat: Create z3_pass #36

merged 3 commits into from
Jul 19, 2024

Conversation

sanjanamandadi
Copy link
Collaborator

Summary

Closes #

Test Plan

@sanjanamandadi sanjanamandadi linked an issue Jul 18, 2024 that may be closed by this pull request
5 tasks
Copy link
Owner

@bliutech bliutech left a comment

Choose a reason for hiding this comment

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

Overall, great work! Some small comments but glad you were able to figure a majority of this tricky task out. If you could also write a better test case so we can actually test to see if the simplification is working.

solver/passes/z3_pass Outdated Show resolved Hide resolved
solver/passes/z3_pass Show resolved Hide resolved
solver/passes/z3_pass Outdated Show resolved Hide resolved
solver/passes/z3_pass Show resolved Hide resolved
def visitVarExpr(self, vex: VarExpr) -> z3.ExprRef:
first: z3.ExprRef = vex.first.acceptRet(self)
if vex.second:
second: z3.ExprRef = vex.second.acceptRet(self)
Copy link
Owner

Choose a reason for hiding this comment

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

This is very close. I think the idea is actually to call AcceptRet on vex.second.first. We want to skip over the AndExpr and OrExpr since these won't return enough context to initialize the Z3 Object.

solver/passes/z3_pass Outdated Show resolved Hide resolved
solver/passes/z3_pass Outdated Show resolved Hide resolved
solver/passes/z3_pass Outdated Show resolved Hide resolved
I left one comment unresolved because I'm not sure if I fixed it correctly!
@bliutech bliutech self-requested a review July 19, 2024 03:06
Copy link
Owner

@bliutech bliutech left a comment

Choose a reason for hiding this comment

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

LGTM!

@bliutech bliutech closed this Jul 19, 2024
@bliutech bliutech reopened this Jul 19, 2024
@bliutech bliutech merged commit 7b8f948 into main Jul 19, 2024
3 checks passed
@bliutech bliutech deleted the 21-solver-implement-z3-simplifier branch July 19, 2024 03:08
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.

Solver: Implement z3 Simplifier
2 participants