Skip to content
Snippets Groups Projects
Commit 608a079a authored by Ralf Jung's avatar Ralf Jung
Browse files

Merge branch 'ralf/map_size_disj_union' into 'master'

add map_size_disj_union

See merge request iris/stdpp!321
parents 10ba5946 d8db31da
No related branches found
No related tags found
No related merge requests found
...@@ -152,6 +152,7 @@ API-breaking change is listed. ...@@ -152,6 +152,7 @@ API-breaking change is listed.
`map_filter_singleton_False`, `map_filter_comm`, `map_union_least`, `map_filter_singleton_False`, `map_filter_comm`, `map_union_least`,
`map_subseteq_difference_l`, `insert_difference`, `insert_difference'`, `map_subseteq_difference_l`, `insert_difference`, `insert_difference'`,
`difference_insert`, `difference_insert_subseteq`. (by Hai Dang) `difference_insert`, `difference_insert_subseteq`. (by Hai Dang)
- Add `map_size_disj_union`.
- Tweak reduction on `gset`, so that `cbn` matches the behavior by `simpl` and - Tweak reduction on `gset`, so that `cbn` matches the behavior by `simpl` and
does not unfold `gset` operations. (by Paolo G. Giarrusso, BedRock Systems) does not unfold `gset` operations. (by Paolo G. Giarrusso, BedRock Systems)
- Add `get_head` tactic to determine the syntactic head of a function - Add `get_head` tactic to determine the syntactic head of a function
......
...@@ -2294,6 +2294,19 @@ Proof. ...@@ -2294,6 +2294,19 @@ Proof.
destruct (m1 !! i), (m2 !! i); simpl; repeat (destruct (f _)); naive_solver. destruct (m1 !! i), (m2 !! i); simpl; repeat (destruct (f _)); naive_solver.
Qed. Qed.
Lemma map_size_disj_union {A} (m1 m2 : M A) :
m1 ## m2 size (m1 m2) = size m1 + size m2.
Proof.
intros Hdisj. induction m1 as [|k x m1 Hm1 IH] using map_ind.
{ rewrite (left_id _ _), map_size_empty. done. }
rewrite <-insert_union_l.
rewrite map_size_insert.
rewrite lookup_union_r by done.
apply map_disjoint_insert_l in Hdisj as [-> Hdisj].
rewrite map_size_insert, Hm1.
rewrite IH by done. done.
Qed.
Lemma map_cross_split {A} (ma mb mc md : M A) : Lemma map_cross_split {A} (ma mb mc md : M A) :
ma ## mb mc ## md ma ## mb mc ## md
ma mb = mc md ma mb = mc md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment