Closed RCoeurjoly closed 2 years ago
Pure functions can only contain a few very specific kinds of statements, in particular, only assignments with a single variable on the left hand side. Commit a2a19df7d833e67841e03c9885869c3dddef3327 adds a proper error message for this.
In your case, I think you could basically just drop the boolean return value from the function, or you could assign the result of the recursive call to a single variable x, and then explicitly return x[1] + 1 in the line below.
When I execute
nagini nagini.py --counterexample
on the following piece of code:I get the following output:
The assertion fails because elements of children are not Nodes? Because that is what I intend to express in the types of init.