Skip to content

Commit

Permalink
Update vst/lib to VST 2.15 and CompCert 3.15 (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-appel authored Jan 8, 2025
1 parent e3b9e18 commit 5736832
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion fcf
Submodule fcf updated 2 files
+1 −0 _CoqProject
+6 −0 src/FCF/Bvector.v
4 changes: 2 additions & 2 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ endif
## Your targets here ##
####################################################################

run-clightgen: proof/math_extern.v proof/malloc_extern.v proof/SC_atomics_extern.v
run-clightgen: proof/math_extern.v proof/malloc_extern.v proof/SC_atomics_extern.v proof/threads.v

include CoqMakefile.local

clean:
rm -f CoqMakefile CoqMakefile.conf
rm -f proof/{*.vo,*.vos,*.vok,*.glob}
rm -f proof/{math_extern.v,malloc_extern.v,SC_atomics_extern.v}
rm -f proof/{math_extern.v,malloc_extern.v,SC_atomics_extern.v,threads.v}
rm -f test/{*.vo,*.vos,*.vok,*.glob}
rm -f test/{incr.v,incr_main.v,testmath.v}

Expand Down
2 changes: 1 addition & 1 deletion lib/proof/spec_threads.v
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Proof.
destruct x as [[[]] pre]; auto.
Qed.

Definition spawned_funtype := Tfunction (Tcons (tptr tvoid) Tnil) tint cc_default.
Definition spawned_funtype := Tfunction (tptr tvoid :: nil) tint cc_default.

Definition spawn_spec := mk_funspec
((tptr spawned_funtype) :: (tptr tvoid) :: nil, tvoid)
Expand Down
3 changes: 0 additions & 3 deletions lib/proof/src/math_extern.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifdef COMPCERT
typedef float _Float16; /* _Float16 is a MacOS thing that CompCert doesn't support */
#endif
#include <math.h>

/* Note regard 'long double':
Expand Down
18 changes: 9 additions & 9 deletions lib/proof/verif_SC_atomics.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,58 @@ Definition Vprog : varspecs. mk_varspecs prog. Defined.
Parameter body_make_atomic:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "make_atomic" (mksignature (AST.Tint :: nil) AST.Tlong cc_default))
(EF_external "make_atomic" (mksignature (Xint :: nil) Xptr cc_default))
make_atomic_spec.

Parameter body_make_atomic_ptr:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "make_atomic_ptr"
(mksignature (AST.Tlong :: nil) AST.Tlong cc_default))
(mksignature (Xptr :: nil) Xptr cc_default))
make_atomic_ptr_spec.

Parameter body_free_atomic:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "free_atomic"
(mksignature (AST.Tlong :: nil) AST.Tvoid cc_default))
(mksignature (Xptr :: nil) Xvoid cc_default))
free_atomic_int_spec.

Parameter body_free_atomic_ptr:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "free_atomic_ptr"
(mksignature (AST.Tlong :: nil) AST.Tvoid cc_default))
(mksignature (Xptr :: nil) Xvoid cc_default))
free_atomic_ptr_spec.

Parameter body_atom_load:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "atom_load"
(mksignature (AST.Tlong :: nil) AST.Tint cc_default))
(mksignature (Xptr :: nil) Xint cc_default))
atomic_load_spec.

Parameter body_atom_store:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "atom_store"
(mksignature (AST.Tlong :: AST.Tint :: nil) AST.Tvoid cc_default))
(mksignature (Xptr :: Xint :: nil) Xvoid cc_default))
atomic_store_spec.

Parameter body_atom_CAS:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "atom_CAS"
(mksignature (AST.Tlong :: AST.Tlong :: AST.Tint :: nil)
AST.Tint cc_default))
(mksignature (Xptr :: Xptr :: Xint :: nil)
Xint cc_default))
atomic_CAS_spec.


Parameter body_atom_exchange:
forall {Espec: OracleKind} ,
VST.floyd.library.body_lemma_of_funspec
(EF_external "atom_exchange"
(mksignature (AST.Tlong :: AST.Tint :: nil) AST.Tint
(mksignature (Xptr :: Xint :: nil) Xint
cc_default))
atomic_exchange_spec.

Expand Down
6 changes: 1 addition & 5 deletions lib/proof/verif_locks.v
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,7 @@ Opaque inv_for_lock.
- Intros r. if_tac; forward_if; try discriminate; try contradiction.
+ forward. simpl spec_locks.lock_inv; entailer!.
+ forward. simpl spec_locks.lock_inv; entailer!.
Unshelve.
apply Build_change_composite_env with (coeq := Maps.PTree.empty bool).
intros. inv H1. intros. unfold cenv_cs; simpl. rewrite !Maps.PTree.gempty.
split; intros [? ?]; discriminate.
Qed.
Qed.

#[global] Opaque M.

Expand Down
2 changes: 1 addition & 1 deletion lib/proof/verif_math.v
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ assert (match ret with
| None => False
end); [ | destruct t; try contradiction; auto].
assert (match rettype_of_type t with
| AST.Tvoid =>
| Xvoid =>
mkEnviron gx (Map.empty (block * type))
(Map.empty val)
| _ =>
Expand Down
3 changes: 0 additions & 3 deletions lib/test/testmath.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifdef COMPCERT
typedef float _Float16; /* _Float16 is a MacOS thing that CompCert doesn't support */
#endif
#include <math.h>

double f(double t) {
Expand Down
2 changes: 1 addition & 1 deletion lib/test/verif_incr.v
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Definition SpawnASI_without_exit :=

Definition incrImports := LockASI ++ SpawnASI_without_exit.
Definition incrInternals := [incr_spec; read_spec; thread_func_spec; compute2_spec].
Definition Gprog : funspecs := incrInternals ++ incrImports.
Definition Gprog : funspecs := incrImports ++ incrInternals.

Lemma ctr_inv_exclusive : forall g1 g2 p,
exclusive_mpred (cptr_lock_inv g1 g2 p).
Expand Down
2 changes: 1 addition & 1 deletion lib/test/verif_incr_main.v
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Definition main_spec :=
PRE [] main_pre whole_prog tt gv
POST [ tint ] PROP() RETURN (Vint (Int.repr 2)) SEP (TT).

Definition Gprog := [main_spec] ++ Main_imports.
Definition Gprog := Main_imports ++ [main_spec].

Lemma body_main: semax_body Vprog Gprog f_main main_spec.
Proof.
Expand Down
10 changes: 10 additions & 0 deletions util/RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
How to generate a release:

1. cd .../vst; git tag -a vX.Y -m "VST release X.Y"; git push origin vX.Y
2. In a fork of the opam-coq-archive,
https://github.com/coq/opam
within directory released/packages/coq-vst



---------THE FOLLOWING INSTRUCTIONS ARE OBSOLETE, from before opam--------
***** reminder about how to generate a release

1. in some other directory, run .../vst/util/PACKAGE
Expand Down

0 comments on commit 5736832

Please sign in to comment.