Effects analysis can further enhance the optimizations performed by the
Stratego optimizer.
The following questions should be answered by effects analysis:
- Does the strategy inspect the current term?
- Does the strategy change the current term?
- Does the strategy have a side-effect (io, table)?
- Does the strategy bind variables?
- Can the strategy fail, or is it guaranteed to succeed?
If the answers to all these questions is no, then the strateg is equivalent to the identity strategy
id
.
In case some answers are no, optimizations may still be possible.
For instance, a sequence
(t; s)
can be reduced to
s
if
s
does not inspect the current term. A
generalization of one of the
build match fusion laws.
--
EelcoVisser - 17 Aug 2003
ToDo,
CategoryToDo?,
StrategoOptimization