You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By considering the program's control flow, it is in principle possible to statically determine some facts about the program's behaviour:
After one iteration of the all statement, there will be no B symbols in the grid, and therefore this statement cannot repeat.
Additionally, since there cannot be any B symbols in the grid at this point, the input pattern [BW] can never have any matches. (This is complicated by the fact that the one statement could itself put some B symbols into the grid, if not for the fact that it can only do so when some B symbols are already present.)
In such cases, a slightly more optimal control-flow graph can be emitted, eliminating some checks which are guaranteed to be true or false, and eliminating dead code. It would also be helpful for the compiler to emit an error or a warning message when an input pattern can never be matched.
If we also consider limits, it would be possible to determine facts such as "at this point in the program, the number of W symbols is between a and b", which could be useful for some other purposes.
The text was updated successfully, but these errors were encountered:
Consider the following program:
By considering the program's control flow, it is in principle possible to statically determine some facts about the program's behaviour:
all
statement, there will be noB
symbols in the grid, and therefore this statement cannot repeat.B
symbols in the grid at this point, the input pattern[BW]
can never have any matches. (This is complicated by the fact that theone
statement could itself put someB
symbols into the grid, if not for the fact that it can only do so when someB
symbols are already present.)In such cases, a slightly more optimal control-flow graph can be emitted, eliminating some checks which are guaranteed to be true or false, and eliminating dead code. It would also be helpful for the compiler to emit an error or a warning message when an input pattern can never be matched.
If we also consider limits, it would be possible to determine facts such as "at this point in the program, the number of
W
symbols is betweena
andb
", which could be useful for some other purposes.The text was updated successfully, but these errors were encountered: