Bound Unbound Variable Analysis

Stratego -- Strategies for Program Transformation
The bound-unbound-vars component of the Stratego optimizer annotates variables with one of the annotations "bound", "unbound", or "(un)bound", with the following meanings:

  • ="bound=" : the variable has been bound in a previous match
  • ="unbound=" : the variable has been declared in a scope, but is not yet bound in a match
  • "(un)bound" : the variable may or may not be bound

Variables are bound in matches, used in builds, and refreshed in scopes. Choice operators may lead to a variable being bound in one path, but not in the other. Such variables are annotated with "(un)bound".

This analysis is used in the StrategoFrontEnd for use def analysis?, in the optimizer for dead variable elimination, and in the back-end to avoid run time checks on variables.

-- EelcoVisser - 17 Aug 2003