--- layout: fc_discuss_archives title: Message 63 from Frama-C-discuss on March 2009 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Verifying recursive functions



>
> I don't understand the assert clause in the code below:
> - "0 <= n" follows from the precondition
> - "n-1 < n" is a tautology
> So the assert clause should always evaluate to true, irrespective of  
> what the program does?

The assertion is there to illustrate how decreases clauses will
work when they are supported.

If the decreases clause had been supported by Jessie, it would
have been translated into a verification condition very much like
the property 0 <= n && n-1 < n; to be proved at the point of the assert.

The fact that the property holds means that the decreases clause is a  
valid one,
and consequently that the termination of the function is guaranteed.

Pascal