Search code examples
frama-c

Frama-c fails to prove verify.c from Allan Blanchard's tutorial


I am trying to learn frama-c from Allan Blanchard's tutorial and I have had trouble verifying the installation as suggested in the tutorial. The author provides a C file with ACSL annotations, all of which frama-c is supposed to be able to prove. However when I run the command (frama-c-gui -wp -rte main.c) I get the following:

Frama-C GUI screenshot

I installed frama-c (version 22.0) via opam (version 2.0.4) on an ocaml-base-compiler.4.11.1 switch. When I installed it I had an issue with Why3 not being able to detect Alt-Ergo and I ended up editing ~/why3.config manually. I mention it here even though I am not sure whether or not it's related to the aformentioned problem.


Solution

  • From what I can judge based on the screenshot, this seems pretty much related indeed. Notably, whenever you see Failed after a prover, this is a sign that something went wrong: a prover simply unable to prove something would rather be indicated as Unknown.

    In your case, I'd tend to think that the issue comes from the fact that Alt-Ergo 2.4.0, the version you are using, is fairly recent (more recent than the latest Why3 version in fact), and is not yet supported by Why3. As mentioned in the reference configuration for Frama-C, Alt-Ergo 2.2.0 is known to be fully supported, hence you may want to opam pin add alt-ergo 2.2.0 to work with that version. After that, don't forget to have Why3 re-detect the provers why3 config --detect-provers. Should this step be a problem, feel free to open a new question on this specific topic (though I suspect that the issue was related to Alt-Ergo 2.4.0).