我有两个问题:
首先,如果我使用内联汇编编写 C 程序,我可以在 VST 中验证整个 C 程序吗?还是只有纯C程序可以验证?
其次,我尝试在 Ubuntu 12.04 上安装最新的 VST 和 Compcert,如http://vst.cs.princeton.edu/上所述,但在某些时候,在将 .v 文件转换为 .vo 文件时出现错误,并显示消息为形式:'不可能将“2”与“8”统一起来'。我认为这个错误是在制作compcert期间发生的,但我不确定。
然后我尝试使用本指南在 Ubuntu 14.04 上安装 VST:' http: //ninj4.net/2014/05/16/hello-vst-hello-verifiable-c.html '。我安装了与指南中相同版本的 Coq、OCaml 和 Menhir。后来当我在 vst 目录中运行 make 时,我遇到了与上面类似的问题。以下是我得到的输出:
Makefile:289: .depend: No such file or directory
coqdep -slash -I msl -as msl -I sepcomp -as sepcomp'...
...
...
'COQC floyd/forward_lemmas.v
COQC floyd/array_lemmas.v
COQC floyd/data_at_lemmas.v
COQC floyd/globals_lemmas.v
File "/home/jhagl/verifiable-c/vst/floyd/data_at_lemmas.v", line 429, characters 49-60:
Error: Impossible to unify "4" with "8".
make: ** * [floyd/data_at_lemmas.vo] Error 1
make: *** Waiting for unfinished jobs....
以下是失败的引理的 data_at_lemmas.v 片段(我已标记第 429 行):
Lemma align_chunk_alignof: forall t ch, access_mode t = By_value ch -> legal_alignas_type t = true -> alignof t = Memdata.align_chunk ch.
Proof.
Transparent alignof.
intros.
destruct t; inversion H.
- unfold legal_alignas_type in H0.
simpl in H0.
destruct i, s; inversion H2; simpl;
destruct (attr_alignas a); try inversion H0; reflexivity.
- unfold legal_alignas_type in H0.
simpl in H0.
destruct s; inversion H2; simpl;
destruct (attr_alignas a); try inversion H0; admit. (* Tlong uncompatible problem *)
- unfold legal_alignas_type in H0.
simpl in H0.
destruct f; inversion H2; simpl;
(\* Line 429 *) destruct (attr_alignas a); try inversion H0; reflexivity.
- unfold legal_alignas_type in H0.
simpl in H0.
inversion H2; simpl;
destruct (attr_alignas a); try inversion H0; reflexivity.
Opaque alignof.
Qed.
顺便说一句,我尝试在 bash: 中运行以下命令
./configure -toolprefix arm-none-eabi- arm-eabi -no-runtime-lib
并收到此错误消息:
./configure: 65: shift: can't shift that many
但是./configure -toolprefix arm-none-eabi- arm-eabi
有效。这不是问题,因为我更改了 Makefile.config。
有关如何解决此问题的任何建议?我还不知道 Coq(我刚刚阅读了指南“Coq in a Hurry”,不过也使用过 HOL)。我有其他新系统,我可以尝试在其上安装 VST(如果有必要的话),即使我已经尝试了两次。
提前致谢。