Skip to content
Snippets Groups Projects
Verified Commit 221197c4 authored by Paolo G. Giarrusso's avatar Paolo G. Giarrusso
Browse files

Add set_unfold_list_bind (+ test)

`set_unfold_bind` for sets already exists; this brings the list variant on par.
parent ebfb79dd
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,8 @@ From stdpp Require Import sets.
Lemma foo `{Set_ A C} (x : A) (X Y : C) : x X Y x X.
Proof. intros Hx. set_unfold in Hx. tauto. Qed.
(** Test [set_unfold_list_bind]. *)
Lemma elem_of_list_bind_again {A B} (x : B) (l : list A) f :
x l ≫= f y, x f y y l.
Proof. set_solver. Qed.
......@@ -308,6 +308,10 @@ Section set_unfold_list.
SetUnfoldElemOf x l P SetUnfoldElemOf x (rotate n l) P.
Proof. constructor. by rewrite elem_of_rotate, (set_unfold_elem_of x l P). Qed.
Global Instance set_unfold_list_bind {B} (f : A list B) l P Q y :
( x, SetUnfoldElemOf x l (P x)) ( x, SetUnfoldElemOf y (f x) (Q x))
SetUnfoldElemOf y (l ≫= f) ( x, Q x P x).
Proof. constructor. rewrite elem_of_list_bind. naive_solver. Qed.
End set_unfold_list.
Tactic Notation "set_unfold" :=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment