feat(mpz_swap): Proved correctness of mpz_swap. Proved some previously admitted lemmas.
This commit is contained in:
@ -692,7 +692,7 @@ Proof.
|
||||
entailer!.
|
||||
rewrite H20.
|
||||
entailer!.
|
||||
apply store_uint_array_rec_def2undef.
|
||||
apply store_uint_array_rec_def2undef; try lia.
|
||||
assert (Zlength l' = n_pre) by lia.
|
||||
rewrite <- H7.
|
||||
tauto.
|
||||
@ -1261,7 +1261,7 @@ Proof.
|
||||
entailer!.
|
||||
rewrite H10.
|
||||
entailer!.
|
||||
apply store_uint_array_rec_def2undef.
|
||||
apply store_uint_array_rec_def2undef; try lia.
|
||||
rewrite <- H29.
|
||||
assert (val_a_prefix = val_a). {
|
||||
rewrite <-H18 in H7.
|
||||
@ -1722,3 +1722,74 @@ Proof.
|
||||
Exists ptr cap size.
|
||||
entailer!.
|
||||
Qed.
|
||||
|
||||
Lemma proof_of_mpz_swap_return_wit_1_1 : mpz_swap_return_wit_1_1.
|
||||
Proof.
|
||||
pre_process.
|
||||
unfold store_Z.
|
||||
Exists ptr2 cap2 size2.
|
||||
Exists ptr1 cap1 size1.
|
||||
Right; Right.
|
||||
entailer!.
|
||||
Qed.
|
||||
|
||||
Lemma proof_of_mpz_swap_return_wit_1_2 : mpz_swap_return_wit_1_2.
|
||||
Proof.
|
||||
pre_process.
|
||||
subst.
|
||||
unfold store_Z.
|
||||
Exists ptr2 cap2 size2.
|
||||
Exists ptr1 cap1 size1.
|
||||
Right; Left.
|
||||
entailer!.
|
||||
Qed.
|
||||
|
||||
Lemma proof_of_mpz_swap_return_wit_1_3 : mpz_swap_return_wit_1_3.
|
||||
Proof.
|
||||
pre_process.
|
||||
unfold store_Z.
|
||||
Exists ptr2 cap2 size2.
|
||||
Exists ptr1 cap1 size1.
|
||||
Left; Right.
|
||||
entailer!.
|
||||
Qed.
|
||||
|
||||
Lemma proof_of_mpz_swap_return_wit_1_4 : mpz_swap_return_wit_1_4.
|
||||
Proof.
|
||||
pre_process.
|
||||
unfold store_Z.
|
||||
Exists ptr2 cap2 size2.
|
||||
Exists ptr1 cap1 size1.
|
||||
Left; Left.
|
||||
entailer!.
|
||||
Qed.
|
||||
|
||||
Lemma proof_of_mpz_swap_which_implies_wit_1 : mpz_swap_which_implies_wit_1.
|
||||
Proof.
|
||||
pre_process.
|
||||
unfold store_Z.
|
||||
Intros ptr cap size.
|
||||
rewrite orp_sepcon_left.
|
||||
Split.
|
||||
+ Right.
|
||||
Exists ptr cap size.
|
||||
entailer!.
|
||||
+ Left.
|
||||
Exists ptr cap size.
|
||||
entailer!.
|
||||
Qed.
|
||||
|
||||
Lemma proof_of_mpz_swap_which_implies_wit_2 : mpz_swap_which_implies_wit_2.
|
||||
Proof.
|
||||
pre_process.
|
||||
unfold store_Z.
|
||||
Intros ptr cap size.
|
||||
rewrite orp_sepcon_left.
|
||||
Split.
|
||||
+ Right.
|
||||
Exists ptr cap size.
|
||||
entailer!.
|
||||
+ Left.
|
||||
Exists ptr cap size.
|
||||
entailer!.
|
||||
Qed.
|
Reference in New Issue
Block a user