Closed panagosg7 closed 10 years ago
[Addresses issue #24]
Allowing a phi variables to be uninitialized when joining environments.
In case of an uninitialized loop phi variable, e.g.
var i; var sum = 0; while (n > 0) { i = n; sum += i; } return sum;
The "invariant" T_i type for i will be: number + undefined.
T_i
i
number + undefined
Types need to be aligned (ziptype) when subtyping the "base" type (before loop) and "step" type (after loop body) against T_i.
ziptype
Wow -- amazing!! that was super fast, thanks @panagosg7 !!! (Since there was quite a bit of changes in the while code, am assuming tests pass?)
while
all tests pass. merging.
[Addresses issue #24]
Allowing a phi variables to be uninitialized when joining environments.
In case of an uninitialized loop phi variable, e.g.
The "invariant"
T_i
type fori
will be:number + undefined
.Types need to be aligned (
ziptype
) when subtyping the "base" type (before loop) and "step" type (after loop body) againstT_i
.