-
Notifications
You must be signed in to change notification settings - Fork 229
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
Question about A2 (ConstProp) - Shadowed by another constant or NAC ? #16
Comments
Perhaps it would be easier to understand from the perspective of the variable's value (whether it is a constant) at a specific program point, rather than how it has been changed before this variable. For the first example, when we focus on the program point after In the second example, when we focus on the program point after These diagrams were generated using tai-e framework to produce the source code and then rendered using graphviz. |
In the test case Assign, analyzing the following code in function Assign.assign():
We can get respectively {x=1}, {x=2}, {x=3} and {x=4} , meaning that we still consider
x
as constant value instead of NAC while its value has been changed.However, in the test case 'Loop', the following function leads to a failure on OJ:
the variable
c
is expected as NAC while my analyzer regards it as constant 1 in the while loop.When should a variable become another constant, and when should it become NAC? It confused me a lot, need I do some dead code detection to it? But I think it's not the task of this assignment.
The text was updated successfully, but these errors were encountered: