Files
why3/examples/stackify/variant.mlcfg
2023-09-28 22:09:56 +02:00

26 lines
365 B
Plaintext

module Anders_Find
use int.Int
let rec cfg find [@cfg:stackify] [@cfg:subregion_analysis] (key : int) : int
=
var cnt : int;
{
cnt <- key;
goto BB0
}
BB0 {
variant { cnt };
switch (cnt > 0)
| True -> goto BB1
| False -> goto Exit
end
}
BB1 {
cnt <- cnt - 1;
goto BB0
}
Exit {
return 0
}
end