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] [wp] unproved goals for strlen() function



Hello,

2014-01-11 16:14, Wolfram Kahl:
> You cannot expect very much without a loop invariant ---
> the only thing known after the loop right now is probably
>
>    *(s - 1) == '\0'
>
> (I haven't done C in a long time) if I remember correctly that
> the ++ increments after the use in the expression...
>
> Your postcondition probably does not follow from that alone...

Wolfram is perfectly right, Xiao-lei you need to add loop invariant to 
*establish* the property you want to prove, i.e. the body of axiom 
strlen(s).

Please find attached an UNFINISHED version of such kind of loop 
invariants. You'll notice that several things are still unproved. More 
home work for you. ;-)

Best regards,
david

-------------- next part --------------
A non-text attachment was scrubbed...
Name: str_len.c
Type: text/x-csrc
Size: 842 bytes
Desc: not available
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20140111/ce54919e/attachment.c>