Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Verifying recursive functions


  • Subject: [Frama-c-discuss] Verifying recursive functions
  • From: Boris.Hollas at de.bosch.com (Hollas Boris (CR/AEY1))
  • Date: Wed, 18 Mar 2009 11:56:30 +0100

Hello,

I use Spec# with Boogie and the Z3 SMT-solver as back-end. Yet, I haven't found a way to verify recursive functions. Therefore, I wonder whether this is possible with frama-c and the Jessie plugin.

For example, consider the following recursive implementation of the factorial function:

    static int fac(int n)
    requires n >= 0;
    ensures result == product {int i in (1..n); i};
    {
        if(n==0) return 1;
        else return n*fak(n-1);
    }

Spec# is not able to prove the postcondition using default settings. Furthermore, I don't know if I can instruct Spec# or the provers to induce on n.

Would frama-c be able to verify the function above?

Cheers,
Boris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20090318/3f761322/attachment.htm