Control flow for conditionals (if/else) #740
aayan636
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have added support for if/else in LineaPy. That means for code written within an
if
block, LineaPy would now be able to perform program slicing to generate cleaned-up code. To demonstrate this behavior, we see the following example:The slice generated by the artifact would be as follows:
Note that we are able to slice out the statement
b = 101
as our analysis is able to infer that this instruction would not affect the artifact fora
.Note: Our analysis currently only works on branches that were visited during the development. In the above example, since the
True
branch was not visited, we do not perform any slicing on the unvisited branch. Support for unvisited branches shall be added in the future.Beta Was this translation helpful? Give feedback.
All reactions