|
|
@@ -35,17 +35,15 @@ let rec unroll_body counters = function
|
|
|
(*
|
|
|
* Look for the following pattern:
|
|
|
* i = 0;
|
|
|
- * while (a < stop) {
|
|
|
+ * while (i < stop) {
|
|
|
* <body>;
|
|
|
- * b = c + step;
|
|
|
+ * i = i + step;
|
|
|
* }
|
|
|
- * where a = b = c = i and start, stop, step are integer constants and i is a
|
|
|
- * generated variable
|
|
|
+ * where start, stop, step are integer constants and i is a generated variable
|
|
|
*)
|
|
|
| (VarLet (VarDec (Int, i, None, _), None, Const (IntVal start, _), _) as init) ::
|
|
|
(While (
|
|
|
- Binop (
|
|
|
- Lt,
|
|
|
+ Binop (Lt,
|
|
|
VarUse (VarDec (Int, comp, None, _), None, _),
|
|
|
Const (IntVal stop, _),
|
|
|
_),
|