loops are not supported when turning statement to expression

Jan 21, 2015 at 9:11 PM
When I make a simple loop in pure ghost function such as
_(def fun()
for(i = 0; i < 10; ++i){

It complains the for loop line with "loops are not supported when turning statement to expression". Anyone got this issue before?
Oct 5, 2015 at 11:57 PM
when defining a function with _(def...) the axiom generated is that the function call returns a value equal to an expression computed by the first-order translation of the function body. Such an expression cannot generally be computed for a function with a loop. If you want to use a def function that iterates, you have to replace the iterations with recursion.

Note that this limitation does not exist for pure ghost functions, whose axioms are generated from the contract rather than the function body. Note however, that there are some soundness issues with pure ghost functions that will not be fixed in VCC3 (the code of which is essentially frozen).