Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use (new) bool2val instead of Val.of_bool #661

Merged
merged 11 commits into from
Feb 7, 2023
Merged
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
CHANGES IN THE WORKS FOR 2.12

- New entailer!! tactic
- Use bool2val instead of Val.of_bool, improves forward_if

CHANGES IN RELEASE 2.11.1 (December 2022)
- Compatible with Coq 8.16.1, 8.15, and (perhaps) 8.14.

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ TWEETNACL_FILES = \
verif_fcore_jbody.v verif_fcore_loop3.v \
verif_fcore_epilogue_hfalse.v verif_fcore_epilogue_htrue.v \
verif_fcore.v verif_crypto_core.v \
verif_crypto_stream_salsa20_xor.v verif_crypto_stream.v \
verif_verify.v
verif_crypto_stream_salsa20_xor1.v verif_crypto_stream_salsa20_xor.v \
verif_crypto_stream.v verif_verify.v

HMACDRBG_FILES = \
entropy.v entropy_lemmas.v DRBG_functions.v HMAC_DRBG_algorithms.v \
Expand Down
8 changes: 4 additions & 4 deletions floyd/client_lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@ Qed.
Lemma typed_false_of_bool':
forall x (P: Prop),
((x=false) -> P) ->
(typed_false tint (Val.of_bool x) -> P).
(typed_false tint (bool2val x) -> P).
Proof.
intuition.
apply H, typed_false_of_bool; auto.
Expand All @@ -1851,7 +1851,7 @@ Qed.
Lemma typed_true_of_bool':
forall x (P: Prop),
((x=true) -> P) ->
(typed_true tint (Val.of_bool x) -> P).
(typed_true tint (bool2val x) -> P).
Proof.
intuition.
apply H, typed_true_of_bool; auto.
Expand Down Expand Up @@ -1881,9 +1881,9 @@ Ltac intro_if_new :=
let H := fresh "P" x in intro H
| |- is_pointer_or_null ?x =>
let H := fresh "PN" x in intro H
| |- typed_false _ (Val.of_bool _) -> _ =>
| |- typed_false _ (bool2val _) -> _ =>
simple apply typed_false_of_bool'
| |- typed_true _ (Val.of_bool _) -> _ =>
| |- typed_true _ (bool2val _) -> _ =>
simple apply typed_true_of_bool'
| |- ptr_eq _ _ -> _ =>
apply ptr_eq_e'
Expand Down
18 changes: 10 additions & 8 deletions floyd/compare_lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ intros.
apply prop_derives; intro.
unfold tptr in H; simpl in H. unfold sem_binary_operation' in H.
simpl in H. rewrite !andb_false_r in H.
destruct (v rho); inv H.
unfold sem_cmp_pp, strict_bool_val, nullval in *.
destruct Archi.ptr64 eqn:Hp; simpl in H1;
try solve [inv H1];
try solve [pose proof (Int64.eq_spec i Int64.zero);
destruct (Int64.eq i Int64.zero); inv H1; auto];
try solve [pose proof (Int.eq_spec i Int.zero);
destruct (Int.eq i Int.zero); inv H1; auto].
simpl in H.
red in H.
forget (v rho) as x. clear - H.
unfold sem_cmp_pp, strict_bool_val, nullval in *; simpl in *.
destruct Archi.ptr64; simpl in H;
destruct x; inv H.
- pose proof (Int64.eq_spec i Int64.zero);
destruct (Int64.eq i Int64.zero); inv H1; auto.
- pose proof (Int.eq_spec i Int.zero);
destruct (Int.eq i Int.zero); inv H1; auto.
Qed.

Definition binary_operation_to_comparison (op: Cop.binary_operation) :=
Expand Down
Loading