Skip to content

Commit f6d4abc

Browse files
committed
Instance to derive Persistent from AsDfractional to help with unification
1 parent 29838ce commit f6d4abc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

new/golang/theory/intoval.v

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,18 @@ Global Instance typed_pointsto_dfractional `{TypedPointsto V} l v :
4040
DFractional (λ dq, typed_pointsto l dq v).
4141
Proof. rewrite typed_pointsto_unseal. apply typed_pointsto_def_dfractional. Qed.
4242

43-
Global Instance typed_pointsto_asdfractional `{TypedPointsto V} l dq v :
43+
Global Instance typed_pointsto_as_dfractional `{TypedPointsto V} l dq v :
4444
AsDFractional (typed_pointsto l dq v) (λ dq, typed_pointsto l dq v) dq.
4545
Proof. split; try done. apply _. Qed.
4646

47+
(* TODO: move higher upstream. *)
48+
Global Instance as_dfractional_persistent P Φ `{AsDFractional _ (P : iProp Σ) Φ DfracDiscarded} :
49+
Persistent P.
50+
Proof.
51+
erewrite as_dfractional. apply dfractional_persistent.
52+
unshelve eapply as_dfractional_dfractional; try eassumption.
53+
Qed.
54+
4755
Global Instance typed_pointsto_combine_sep_gives `{TypedPointsto V} l dq1 v1 dq2 v2 :
4856
CombineSepGives (typed_pointsto l dq1 v1)
4957
(typed_pointsto l dq2 v2) (⌜ v1 = v2 ⌝).

0 commit comments

Comments
 (0)