-
Notifications
You must be signed in to change notification settings - Fork 27
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
Check_ReorderLoops fails when reduction is not in reduction syntax #557
Comments
It seems like there is two bugs? The case that is passing seems to be dispatching a query without any effects to verify? |
Here is a minimal test that replicates the bug. z3-solver (4.12.4.0) reports unsat (instead of unknown on this test):
|
I think this might be an expected behavior. The body here doesn't commute with itself because the general case where one statement is reading |
One idea is to have an internal rewrite pass within the analysis the folds all assignments into a reduction form if possible before generating the SMT queries. The rewrites shouldn't propagate to the caller scheduling operation itself. |
This PR implements two operations: 1. fold_into_reduce: folds an assignment into a reduction format 2. left_reassociate_expr: changes the associativity of addition and multiplication. This can be used to help with (1). The primary reason behind this PR is being able to put assignments into reduction format which some analysis depends on (e.g. #557).
The following program returns
unknown
result on z3 4.12.4.0 (and unsat result on z3 4.12.5.0) when trying to reorder loopsioo
andioi
:However, switching the following assignment to a reduction:
Let's it pass (on both versions). Is this an expected behavior or a bug?
Here is the debug info when the statement is in assignment form:
Here is the debug info when the statement is in reduce form:
The text was updated successfully, but these errors were encountered: