2

I'm implementing a static anaylsis as a plugin for Frama-C and as a part of this analysis I need to generate weakest precondition formulae. I have found this related question, How do I use the results of WP in another plug-in? , however the answer only amounts to that there is an API for the WP plugin, not how to use it for this specific task. The WP API documentation is mostly a reference list of types, functions and classes and contains very little information about how the different parts fit together and how they are intended to be used (I'm new to Ocaml so maybe I have missed something "obvious" here). I have spent some time with the API documentation, the WP Plugin Manual as well as the Frama-C Developer Manual but I have only been able to get the verification conditions generated by the WP plugin, not a raw weakest precondition formula as the result of a wp predicate transformer.

Is there a way, preferably exposed in the WP API, to generate a weakest precondition formula for a given function and input formula?

If there is a way to do this, what modules should I be looking at and roughly what would the workflow look like? E.g. should I run the WP plugin normally and somehow extract the result or invoke only some select functions needed for wp calculation?


Edit:

My search has led me to investigate the following function which looks promising:

Calculus.Cfg.compute : Cil2cfg.t -> 
             WpStrategy.strategy ->
             W.t_prop list * (Format.formatter -> Cil2cfg.edge -> unit)

Is using this function for an instantiation of the Calculus.Cfg functor a correct approach? If this is the case, what is the purpose of a WpStrategy.strategy in this context and how do I properly construct it? (These are different from the strategies mentioned in the manual, right?)

wup
  • 21
  • 4

0 Answers0