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] Substitution in Cil_types.predicate


  • Subject: [Frama-c-discuss] Substitution in Cil_types.predicate
  • From: hollas at informatik.htw-dresden.de (Boris Hollas)
  • Date: Fri, 16 Mar 2012 12:20:55 +0100
  • In-reply-to: <CA+yPOVjEiv_gA1=eCSPgmFf6TRuy5mE3n5Z91EAnzKg3K9SEHw@mail.gmail.com>
  • References: <1330091763.2071.50.camel@iti27.informatik.htw-dresden.de> <CA+yPOVgMt=gL_ta6EybZdxEdueW+-S0UMOgfXND8EH90VUF_GA@mail.gmail.com> <1331537104.6161.846.camel@iti27.informatik.htw-dresden.de> <CA+yPOVjEiv_gA1=eCSPgmFf6TRuy5mE3n5Z91EAnzKg3K9SEHw@mail.gmail.com>

Hello Virgile,

> I'm not sure I'm following you here: by definition *p is not a
> logic_var. Do you mean that you have x and p, with p having pointer
> type and needing possibly several dereferences in order to obtain a
> value of the same type as x?

yes

> Yes, this is the only sensible solution here: if you have several
> levels of pointers and want to get an int, you have to add several
> levels of TMem. And indeed, there's no function in the
> kernel to do that.

Ok. Thanks for pointing this out! It might have been possible that
someone has already done it.

> Why would tvar do that? It is a constructor. It does not try to build
> an integral value from an arbitrary variable lv (in fact that does not
> have any sense in the general case). Its purposes is only to build the
> term corresponding to lv i.e.

I agree if the meaning of the Logic_const.tX functions is "make a term
that is an X". Without further documentation, tvar lv could also be
understood as "make a term that corresponds to lv and represents
lv.lv_type" (ie, Cil.d_term (tvar lv) would pretty print *p for a
logic_var p of type int*). I know now that this notion is wrong.

-- 
Best regards,
Boris