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] ACSL contracts lost during GFun modification in Ast Copy


  • Subject: [Frama-c-discuss] ACSL contracts lost during GFun modification in Ast Copy
  • From: stephane.duprat at atos.net (DUPRAT Stephane)
  • Date: Fri, 28 Oct 2011 22:21:24 +0000
  • In-reply-to: <4EAACC3E.6010902@cea.fr>
  • References: <569C6D7D26484241A530B87F45ADE1F87E5E5B@AOFRWMBXRSC004.resources.atosorigin.local> <4EAACC3E.6010902@cea.fr>

Dear Virgile,

I've now understood the difference between ChangeTo et ChangeDoChildrenPost.
And ChangeDoChildrenPost(g,fun x -> x) is working fine.

Thanks a lot.

Stephane

> -----Message d'origine-----
> De : frama-c-discuss-bounces at lists.gforge.inria.fr [mailto:frama-c-
> discuss-bounces at lists.gforge.inria.fr] De la part de Virgile Prevosto
> Envoy? : vendredi 28 octobre 2011 17:38
> ? : Frama-C public discussion
> Objet : Re: [Frama-c-discuss] ACSL contracts lost during GFun
> modification in Ast Copy
>
> Hello St?phane,
>
> On 28/10/2011 17:04, DUPRAT Stephane wrote:
> > Hello,
> >
> > I'm working on a new Frama-C project built by the cmd
> > "File.create_project_from_visitor" and I lose the ACSL contract if a
> > make a change to a global function.
> >
> > For example, if have a copy visitor like this:
> >
> > inherit Visitor.frama_c_copy prj method vglob_aux g = match g with |
> > GFun (_)  -> Cil.ChangeTo [g]
> >
> > All functions have lost their contract in the copy project. Is there
> > a way to keep contracts of the original function ? Perhaps throw the
> > kernel_functions, but they are not handle by the visitor.
> >
>
> As a rule of thumb, whenever you use SkipChildren or ChangeTo in a
> visitor, the visit stop there. In particular, since a function contract
> is considered somehow as a child of the global it belongs to, the
> contract will not be visited, (and not copied in the new project when
> you have a copy visitor).
>
> By the way, the use of ChangeTo in your code snippet is incorrect: the
> function (and in particular its statements, the varinfos of formals and
> globals, etc.) are shared between original and new projects. In fact,
> ChangeTo g should only be used in a copy visitor if g has been built
> from scratch by the visitor (that must also add to the action queue the
> registration of the new contract if needed). Developer's manual
> suggests
> to use ChangeDoChildrenPost(g,fun x -> x) instead, to ensure that all
> the nodes will be visited and copied.
>
> Best regards,
> --
> E tutto per oggi, a la prossima volta
> Virgile
>
> _______________________________________________
> Frama-c-discuss mailing list
> Frama-c-discuss at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/frama-c-discuss
________________________________


Ce message et les pi?ces jointes sont confidentiels et r?serv?s ? l'usage exclusif de ses destinataires. Il peut ?galement ?tre prot?g? par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir imm?diatement l'exp?diteur et de le d?truire. L'int?grit? du message ne pouvant ?tre assur?e sur Internet, la responsabilit? du groupe Atos ne pourra ?tre engag?e quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'exp?diteur ne donne aucune garantie ? cet ?gard et sa responsabilit? ne saurait ?tre engag?e pour tout dommage r?sultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.