Skip to content

Commit

Permalink
Address issue #773 by removing the problematic line in normalize1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-appel committed May 7, 2024
1 parent 36d993e commit 4cd0f6c
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions floyd/call_lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ Proof.
apply bi.pure_mono; simpl; auto.
- apply bi.exist_elim; intros.
rewrite /PROPx /=.
split => rho; monPred.unseal.
normalize.
Qed.

Expand Down
1 change: 1 addition & 0 deletions floyd/client_lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ Proof.
unfold PROPx in *.
intros.
rewrite fold_right_cons.
go_lowerx.
normalize.
rewrite -H //.
monPred.unseal.
Expand Down
6 changes: 4 additions & 2 deletions floyd/forward.v
Original file line number Diff line number Diff line change
Expand Up @@ -4455,8 +4455,10 @@ Lemma compute_close_precondition_entails2:
close_precondition ids (PROPx P (LAMBDAx gv vals (SEPx R)))
⊢ (PROPx(Σ:=Σ) P (LOCALx ((map gvars gv)++Q) (SEPx R))).
Proof.
intros. rewrite <- insert_locals. unfold close_precondition; normalize. raise_rho. super_unfold_lift.
unfold GLOBALSx, PARAMSx, argsassert2assert, PROPx, LOCALx, SEPx. normalize.
intros. rewrite <- insert_locals.
unfold close_precondition; split => rho; monPred.unseal; normalize. raise_rho. super_unfold_lift.
unfold GLOBALSx, PARAMSx, argsassert2assert, PROPx, LOCALx, SEPx.
normalize.
apply bi.and_intro; [|by done].
rewrite bi.pure_and; apply bi.and_intro.
{ apply bi.pure_intro.
Expand Down
3 changes: 2 additions & 1 deletion floyd/forward_lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ destruct Post as [?P ?P ?P ?P]; simpl; normalize.
intros vl; destruct Post as [?P ?P ?P ?P]; simpl; normalize.
*
eapply semax_pre_simple; [ | apply semax_break].
destruct Post as [?P ?P ?P ?P]; simpl; normalize.
destruct Post as [?P ?P ?P ?P]; simpl.
split => rho; monPred.unseal; normalize.
eapply derives_trans; [ | apply H1].
rewrite (bi.and_comm (Q rho)).
simpl.
Expand Down
2 changes: 2 additions & 0 deletions floyd/go_lower.v
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ Proof.
intros.
erewrite local2ptree_soundness by eassumption.
rewrite assoc msubst_eval_lvalue_eq //.
split => rho; monPred.unseal.
normalize.
apply bi.pure_elim_r; intros ->; done.
Qed.
Expand All @@ -460,6 +461,7 @@ Proof.
intros.
erewrite local2ptree_soundness by eassumption.
rewrite assoc msubst_eval_expr_eq //.
split => rho; monPred.unseal.
normalize.
apply bi.pure_elim_r; intros ->; done.
Qed.
Expand Down
1 change: 1 addition & 0 deletions floyd/loadstore_mapsto.v
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ Proof.
with (eval_expr (Ecast e2 t1)).
Opaque eval_lvalue eval_expr.
unfold local, lift1; unfold_lift; simpl.
go_lowerx.
normalize.
Transparent eval_lvalue eval_expr.
subst t1.
Expand Down
7 changes: 3 additions & 4 deletions floyd/local2ptree_denote.v
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,8 @@ Lemma LOCALx_shuffle_derives': forall P Q Q' R,
Proof.
intros.
induction Q'.
{
unfold PROPx, LOCALx.
{ go_lowerx.
normalize.
solve_andp.
}
pose proof (H a (or_introl _ eq_refl)).
rewrite <- insert_local'.
Expand Down Expand Up @@ -841,8 +839,9 @@ assert (forall rho, local(Σ:=Σ) (tc_environ Delta) rho ⊢ ⌜Map.get (ve_of r
clear - H2 H2' H3 TC.
rewrite -insert_SEP.
unfold func_ptr.
split => rho; monPred.unseal.
normalize.
iIntros "(%H0 & H1 & H2)". iSplit. 2: { done. }
iIntros "(%H0 & H1 & H2)". iSplit. 2: { done. }
rewrite H3.
iPoseProof (in_local _ Delta (l ++ P) _ (SEPx R) H2 with "[H1]") as "H3".
{ rewrite /PROPx /LOCALx. iSplit; done. }
Expand Down
1 change: 1 addition & 0 deletions floyd/local2ptree_typecheck.v
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Proof.
- eapply derives_trans; [eapply msubst_eval_expr_eq; eauto |].
apply bi.impl_intro_r.
unfold local, lift1; unfold_lift.
split => rho; monPred.unseal;
normalize.
- and_elim_rightmost.
+ simpl msubst_denote_tc_assert; simpl denote_tc_assert.
Expand Down
1 change: 1 addition & 0 deletions floyd/sc_set_load_store.v
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Proof.
rewrite <- insert_local.
eapply derives_trans; [| apply bi.and_mono; [apply derives_refl | apply remove_localdef_temp_PROP]].
(* TODO maybe normalize shouldn't unfold local? *)
split => rho; monPred.unseal.
Opaque local. normalize. Transparent local.
apply (bi.exist_intro' _ _ x).
rewrite bi.and_comm -bi.and_assoc bi.and_comm.
Expand Down
2 changes: 2 additions & 0 deletions floyd/seplog_tactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,9 @@ Ltac safe_done :=

Ltac normalize1 :=
match goal with
(* SEE ISSUE https://github.com/PrincetonUniversity/VST/issues/773
| |- bi_entails(PROP := monPredI _ _) _ _ => let rho := fresh "rho" in split => rho; monPred.unseal
*)
| |- context [((⌜?P⌝ ∧ ?Q) ∗ ?R)%I] => rewrite -> (sepcon_andp_prop' Q P R)
| |- context [(?P ∗ (⌜?Q⌝ ∧ ?R))%I] => rewrite -> (sepcon_andp_prop P Q R)
| |- context [((?Q ∧ ⌜?P⌝) ∗ ?R)%I] => rewrite -> (sepcon_andp_prop2' P Q R)
Expand Down
2 changes: 0 additions & 2 deletions progs64/verif_io.v
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ Proof.
entailer!.
- forward.
entailer!.
- entailer!.
Qed.

Lemma chars_of_Z_eq : forall n, chars_of_Z n =
Expand Down Expand Up @@ -269,7 +268,6 @@ Proof.
- forward_call (i, tr).
{ rewrite -> chars_of_Z_intr by lia; cancel. }
entailer!.
- entailer!.
Qed.

Lemma read_sum_eq : forall n d, read_sum n d ≈
Expand Down

0 comments on commit 4cd0f6c

Please sign in to comment.