Skip to content
Snippets Groups Projects
Commit 30a89e56 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Use the new LimitPreserving stuff.

It is still not as nice as it could be; we need more automation to
prove Propers.
parent cde0d062
Branches
No related tags found
No related merge requests found
Pipeline #
...@@ -36,15 +36,14 @@ Section fixpoint. ...@@ -36,15 +36,14 @@ Section fixpoint.
- exists bool. apply _. - exists bool. apply _.
- done. - done.
- (* If Copy was an Iris assertion, this would be trivial -- we'd just - (* If Copy was an Iris assertion, this would be trivial -- we'd just
use entails_lim once. However, on the Coq side, it is more convenient use limit_preserving_and directly. However, on the Coq side, it is
as a record -- so this is where we pay. *) more convenient as a record -- so this is where we pay. *)
intros c Hc. split. eapply (limit_preserving_ext (λ _, _ _)).
+ intros tid vl. rewrite /PersistentP. entails_lim c; [solve_proper..|]. { split; (intros [H1 H2]; split; [apply H1|apply H2]). }
intros. apply (Hc n). apply limit_preserving_and; repeat (apply limit_preserving_forall=> ?).
+ intros κ tid E F l q ? ?. entails_lim c; first solve_proper. { apply uPred.limit_preserving_PersistentP; solve_proper. }
* solve_proper_core ltac:(fun _ => eapply ty_size_ne || f_equiv). apply limit_preserving_impl, uPred.limit_preserving_entails;
* intros n. apply (Hc n); first done. erewrite ty_size_ne; first done. solve_proper_core ltac:(fun _ => eapply ty_size_ne || f_equiv).
rewrite conv_compl. done.
Qed. Qed.
Global Instance fixpoint_send : Global Instance fixpoint_send :
...@@ -55,7 +54,8 @@ Section fixpoint. ...@@ -55,7 +54,8 @@ Section fixpoint.
- apply send_equiv. - apply send_equiv.
- exists bool. apply _. - exists bool. apply _.
- done. - done.
- intros c Hc ???. entails_lim c; [solve_proper..|]. intros n. apply Hc. - repeat (apply limit_preserving_forall=> ?).
apply uPred.limit_preserving_entails; solve_proper.
Qed. Qed.
Global Instance fixpoint_sync : Global Instance fixpoint_sync :
...@@ -66,7 +66,8 @@ Section fixpoint. ...@@ -66,7 +66,8 @@ Section fixpoint.
- apply sync_equiv. - apply sync_equiv.
- exists bool. apply _. - exists bool. apply _.
- done. - done.
- intros c Hc ????. entails_lim c; [solve_proper..|]. intros n. apply Hc. - repeat (apply limit_preserving_forall=> ?).
apply uPred.limit_preserving_entails; solve_proper.
Qed. Qed.
Lemma fixpoint_unfold_eqtype E L : eqtype E L (type_fixpoint T) (T (type_fixpoint T)). Lemma fixpoint_unfold_eqtype E L : eqtype E L (type_fixpoint T) (T (type_fixpoint T)).
...@@ -90,8 +91,8 @@ Section subtyping. ...@@ -90,8 +91,8 @@ Section subtyping.
- intros ?? EQ ?. etrans; last done. by apply equiv_subtype. - intros ?? EQ ?. etrans; last done. by apply equiv_subtype.
- by eexists _. - by eexists _.
- intros. setoid_rewrite (fixpoint_unfold_eqtype T2). by apply H12. - intros. setoid_rewrite (fixpoint_unfold_eqtype T2). by apply H12.
- intros c Hc. rewrite /subtype. entails_lim c; [solve_proper..|]. - repeat (apply limit_preserving_forall=> ?).
intros n. apply Hc. apply uPred.limit_preserving_entails; solve_proper.
Qed. Qed.
Lemma fixpoint_proper T1 `{TypeContractive T1} T2 `{TypeContractive T2} : Lemma fixpoint_proper T1 `{TypeContractive T1} T2 `{TypeContractive T2} :
...@@ -103,8 +104,8 @@ Section subtyping. ...@@ -103,8 +104,8 @@ Section subtyping.
- intros ?? EQ ?. etrans; last done. by apply equiv_eqtype. - intros ?? EQ ?. etrans; last done. by apply equiv_eqtype.
- by eexists _. - by eexists _.
- intros. setoid_rewrite (fixpoint_unfold_eqtype T2). by apply H12. - intros. setoid_rewrite (fixpoint_unfold_eqtype T2). by apply H12.
- intros c Hc. split; rewrite /subtype; (entails_lim c; [solve_proper..|]); - apply limit_preserving_and; repeat (apply limit_preserving_forall=> ?);
intros n; apply Hc. apply uPred.limit_preserving_entails; solve_proper.
Qed. Qed.
Lemma fixpoint_unfold_subtype_l ty T `{TypeContractive T} : Lemma fixpoint_unfold_subtype_l ty T `{TypeContractive T} :
......
...@@ -152,23 +152,16 @@ Section ofe. ...@@ -152,23 +152,16 @@ Section ofe.
Global Instance type_cofe : Cofe typeC. Global Instance type_cofe : Cofe typeC.
Proof. Proof.
apply: (iso_cofe_subtype P type_pack type_unpack). apply (iso_cofe_subtype' P type_pack type_unpack).
- by intros [].
- split; [by destruct 1|by intros [[??] ?]; constructor]. - split; [by destruct 1|by intros [[??] ?]; constructor].
- by intros []. - by intros [].
- intros ? c. rewrite /P /=. split_and!. - (* TODO: automate this *)
(* TODO: Can we do these proofs without effectively going into the model? *) repeat apply limit_preserving_and; repeat (apply limit_preserving_forall; intros ?).
+ intros κ tid l. apply uPred.entails_equiv_and, equiv_dist=>n. + apply uPred.limit_preserving_PersistentP=> n ty1 ty2 Hty; apply Hty.
setoid_rewrite conv_compl; simpl. + apply uPred.limit_preserving_entails=> n ty1 ty2 Hty. apply Hty. by rewrite Hty.
apply equiv_dist, uPred.entails_equiv_and, ty_shr_persistent. + apply uPred.limit_preserving_entails=> n ty1 ty2 Hty; repeat f_equiv; apply Hty.
+ intros tid vl. apply uPred.entails_equiv_and, equiv_dist=>n. + apply uPred.limit_preserving_entails=> n ty1 ty2 Hty; repeat f_equiv; apply Hty.
repeat setoid_rewrite conv_compl at 1. simpl.
apply equiv_dist, uPred.entails_equiv_and, ty_size_eq.
+ intros E κ l tid q ?. apply uPred.entails_equiv_and, equiv_dist=>n.
setoid_rewrite conv_compl; simpl.
by apply equiv_dist, uPred.entails_equiv_and, ty_share.
+ intros κ κ' tid l. apply uPred.entails_equiv_and, equiv_dist=>n.
setoid_rewrite conv_compl; simpl.
apply equiv_dist, uPred.entails_equiv_and, ty_shr_mono.
Qed. Qed.
Inductive st_equiv' (ty1 ty2 : simple_type) : Prop := Inductive st_equiv' (ty1 ty2 : simple_type) : Prop :=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment