用户错误:在why3.conf 中找不到证明者“alt-ergo”

I. *_*Ali 3 frama-c alt-ergo why3

我正在尝试使用 Frama-c 测试一个函数:

/*@
    ensures \result >= x && \result >= y;
    ensures \result == x || \result == y;
*/

int max( int x, int y){
    return (x>y) ? x : y;
}   
Run Code Online (Sandbox Code Playgroud)

安装完所有要求后:OPAM、why3、alt-ergo 每当我执行frama-c -wp fct.c我收到:

[kernel] Parsing fct.c (with preprocessing)
[wp] Warning: Missing RTE guards
[wp] User Error: Prover 'alt-ergo' not found in why3.conf
[wp] Goal typed_max_ensures : not tried
[wp] Goal typed_max_ensures_2 : not tried
[wp] User Error: Deferred error message was emitted during execution. 
See above messages for more information.
[kernel] Plug-in wp aborted: invalid user input.
Run Code Online (Sandbox Code Playgroud)

Vir*_*ile 9

正如在Frama-C 的安装说明中提到why3必须通过why3 config --detect命令明确地配置为检查可用的证明器(请注意,根据您安装的 Why3 的​​确切版本,您也可以why3 config --full-config改用)。您应该看到如下输出:

Found prover Alt-Ergo version 2.0.0, OK.
... possibly other provers if you have installed them
Save config to /PATH/TO/HOME/.why3.conf
Run Code Online (Sandbox Code Playgroud)

之后,您将能够在 Frama-C/WP 中使用证明程序

  • 好像命令行变了?我需要`why3 config detector`,我有why3 v1.4.0。看起来 `opam install Why3` 试图告诉你这一点。最后的消息是 *=> Why3 证明者设置: rm -f ~/.why3.conf ;Why3 config detector*,但如果您从未使用过 opam,则不清楚这是给用户的说明。我认为这是由 opam 执行的命令。 (3认同)