4

I have installed frama-c using opam and homebrew, following the instructions from the frama-c site. I'm on Mac OS X (El Capitan), and the versions are:

  • frama-c: Magnesium-20151002
  • alt-ergo: 1.01
  • ocaml: 4.02.3

When I attempt to run with the swap.c tutorial, it fails to verify. Here's the error I get:

[ frama-c ]> frama-c -wp -wp-out temp swap.c swap1.h 
[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing swap.c (with preprocessing)
[kernel] Parsing swap1.h (with preprocessing)
[wp] warning: Missing RTE guards
[wp] 2 goals scheduled
------------------------------------------------------------
--- Alt-Ergo (stdout) :
------------------------------------------------------------
File "temp/typed/swap_post_A_Alt-Ergo.mlw", line 786, characters 1-299:Valid (0.0093) (12 steps)
------------------------------------------------------------
[wp] [Alt-Ergo] Goal typed_swap_post_A : Failed
     Error: Can not understand Alt-Ergo output.
[wp] Proved goals:    1 / 2
     Qed:             1 
     Alt-Ergo:        0  (failed: 1)

The output message seems to suggest that alt-ergo could prove the assertion, but then frama-c could not parse the output. Could this be because the alt-ergo version is too new? Here is the goal on line 786 of the generated file, referenced in the above output:

goal swap_post_A:
  forall t : (addr,int) farray.
  forall a_1,a : addr.
  let x = t[a] : int in
  let x_1 = t[a_1] : int in
  let x_2 = t[a_1 <- x][a <- x_1][a_1] : int in
  is_sint32(x) ->
  is_sint32(x_1) ->
  (region(a.base) <= 0) ->
  (region(a_1.base) <= 0) ->
  is_sint32(x_2) ->
  (x = x_2)

If I run alt-ergo on this generated file directly, it returns with code 0.

Mike Hicks
  • 41
  • 1
  • To answer my own question: If I change how alt-ergo is invoked by replacing it with a script that includes the flag -backward-compat then it works. So it seems that opam/homebrew currently produce a toxic configuration. – Mike Hicks Apr 04 '16 at 19:49
  • 1
    It's not an issue of opam/homebrew. The problem is that Frama-C Magnesium-20151002 is not able to parse Alt-Ergo 1.01's output. And I don't think it's a good idea to forbid the installation of these versions together since -backward-compat resolves the problem. – iguerNL Apr 05 '16 at 08:45
  • 1
    @MikeHicks instead of a script, you can use option `-alt-ergo-opt` to instruct WP to pass specific options to `-wp-alt-ergo`. – Virgile Apr 05 '16 at 08:58
  • When I run with `-wp-alt-ergo-opt="-backward-compat" ` that does the trick. Thanks! – Mike Hicks Apr 05 '16 at 12:17

0 Answers0