stdpp merge requestshttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests2021-07-21T17:11:43Zhttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/302`Params` and `Proper` instances for `curry` and friends2021-07-21T17:11:43ZRobbert Krebbers`Params` and `Proper` instances for `curry` and friendshttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/301rename map_union_subseteq_l_alt → map_union_subseteq_l' (and likewise for _r)2021-07-21T11:04:34ZRalf Jungjung@mpi-sws.orgrename map_union_subseteq_l_alt → map_union_subseteq_l' (and likewise for _r)This is more consistent with `or_intro_{l,r}'` and https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/300.This is more consistent with `or_intro_{l,r}'` and https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/300.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/300solve_ndisj: solve more goals involving chains of differences2021-07-21T11:16:09ZRalf Jungjung@mpi-sws.orgsolve_ndisj: solve more goals involving chains of differencesThis improves `solve_ndisj` to handle goals that came up in iris/examples as part of the logically atomic triple mask change.This improves `solve_ndisj` to handle goals that came up in iris/examples as part of the logically atomic triple mask change.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/299alternative implementation of mk_evar that keeps naive_solver working2021-07-21T07:06:02ZRalf Jungjung@mpi-sws.orgalternative implementation of mk_evar that keeps naive_solver workingThis uses [a hack](https://stackoverflow.com/questions/45949064/check-for-evars-in-a-tactic-that-returns-a-value/46178884#46178884) to have side-effects in an ltac that returns a value.
Fixes https://gitlab.mpi-sws.org/iris/stdpp/-/issu...This uses [a hack](https://stackoverflow.com/questions/45949064/check-for-evars-in-a-tactic-that-returns-a-value/46178884#46178884) to have side-effects in an ltac that returns a value.
Fixes https://gitlab.mpi-sws.org/iris/stdpp/-/issues/115https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/298Mark gset methods as simpl never to stop `cbn` from unfolding them2021-07-28T14:15:12ZPaolo G. GiarrussoMark gset methods as simpl never to stop `cbn` from unfolding themThis clarifies what's meant to happen anyway, and is apparently needed for `cbn`. (I haven't yet tried doing this at the `mapset` level).
Example of the problem: without this change, `cbn` mangles the goal in the following:
```
Goal {...This clarifies what's meant to happen anyway, and is apparently needed for `cbn`. (I haven't yet tried doing this at the `mapset` level).
Example of the problem: without this change, `cbn` mangles the goal in the following:
```
Goal {[1; 2; 3]} =@{gset nat} ∅.
Fail progress simpl.
progress cbn. Show.
```
I'd want `progress cbn` to fail, instead the above gives:
```
The command has indeed failed with message:
Failed to progress.
1 subgoal
============================
{| mapset_car := {[1 := ()]} ∪ {[2 := ()]} ∪ {[3 := ()]} |} = ∅
```https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/297Swap `curry` and `uncurry` to be consistent with Haskell and friends.2021-07-20T10:03:27ZRobbert KrebbersSwap `curry` and `uncurry` to be consistent with Haskell and friends.This also applies to `(un)curry{3,4}`, `gmap_(un)curry`, and `h(un)curry`.
This fixes issue #76.
The code includes a horrible hack that should removed once support for Coq versions prior
to 8.13 is dropped, see https://github.com/coq/c...This also applies to `(un)curry{3,4}`, `gmap_(un)curry`, and `h(un)curry`.
This fixes issue #76.
The code includes a horrible hack that should removed once support for Coq versions prior
to 8.13 is dropped, see https://github.com/coq/coq/pull/12716.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/296Do not call `done` recursively when solving `is_Some`.2021-07-15T18:03:56ZRobbert KrebbersDo not call `done` recursively when solving `is_Some`.!293 broke Iris, this MR fixes that.!293 broke Iris, this MR fixes that.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/294handle more goals in solve_ndisj2021-07-19T10:52:46ZRalf Jungjung@mpi-sws.orghandle more goals in solve_ndisjWe should only land this after the deadline since solving more goals can break things.We should only land this after the deadline since solving more goals can break things.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/293Make `done` work on `is_Some`.2021-07-15T12:21:39ZRobbert KrebbersMake `done` work on `is_Some`.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/292add lookup_union_l2021-07-03T16:47:26ZRalf Jungjung@mpi-sws.orgadd lookup_union_lWe have `lookup_union_r`, this matches a symmetric `lookup_union_l`.We have `lookup_union_r`, this matches a symmetric `lookup_union_l`.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/291Fix priority of `Permutation_app'`.2021-07-15T11:01:57ZRobbert KrebbersFix priority of `Permutation_app'`.This is a workaround for https://github.com/coq/coq/issues/14571
This fixes #114.
This fixes a regression caused by !270.This is a workaround for https://github.com/coq/coq/issues/14571
This fixes #114.
This fixes a regression caused by !270.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/290Update changelog for filter extensionality lemmas2021-06-28T17:51:37ZSimon Friis VindumUpdate changelog for filter extensionality lemmasI think this MR makes the changes a bit more clear and it adds the rename to the sed script.I think this MR makes the changes a bit more clear and it adds the rename to the sed script.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/289add mk_evar tactic (to replace Coq's strange evar tactic) and use it2021-07-16T13:57:06ZRalf Jungjung@mpi-sws.orgadd mk_evar tactic (to replace Coq's strange evar tactic) and use itSee [discussion on Mattermost](https://mattermost.mpi-sws.org/iris/pl/m88qt68ggiyhmyb3bqa7yant1w)See [discussion on Mattermost](https://mattermost.mpi-sws.org/iris/pl/m88qt68ggiyhmyb3bqa7yant1w)https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/288Make sum_inhabited_r not a copy of sum_inhabited_l2021-06-27T11:41:34ZPaolo G. GiarrussoMake sum_inhabited_r not a copy of sum_inhabited_lThis existed at least as far back as
iris/stdpp@361308c7b173f353afd99499e8bfcf168fdab1ca, 8 years ago.This existed at least as far back as
iris/stdpp@361308c7b173f353afd99499e8bfcf168fdab1ca, 8 years ago.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/287rename insert_delete → insert_delete_insert; add new insert_delete matching d...2021-06-26T20:45:07ZRalf Jungjung@mpi-sws.orgrename insert_delete → insert_delete_insert; add new insert_delete matching delete_insertAs [discussed](https://mattermost.mpi-sws.org/iris/pl/kcrrarwgt3bhikewccqxyrb3za) this is currently inconsistent.
I propose we use `insert_delete` for the lemma with a precondition since it is used 7 times in std++ after this MR; the on...As [discussed](https://mattermost.mpi-sws.org/iris/pl/kcrrarwgt3bhikewccqxyrb3za) this is currently inconsistent.
I propose we use `insert_delete` for the lemma with a precondition since it is used 7 times in std++ after this MR; the one without a precondition is used just 3 times (one of which is to prove `insert_delete`).https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/286Fix potential stack overflow related to `Pretty N`.2021-06-25T15:21:23ZRobbert KrebbersFix potential stack overflow related to `Pretty N`.As reported by @simongregersen at https://coq.zulipchat.com/#narrow/stream/237977-Coq-users/topic/Stack.20overflow.20in.20Qed.2E, lemmas involving `Pretty N` could lead to stack overflow. I minimized his problem as follows:
```coq
Lemma...As reported by @simongregersen at https://coq.zulipchat.com/#narrow/stream/237977-Coq-users/topic/Stack.20overflow.20in.20Qed.2E, lemmas involving `Pretty N` could lead to stack overflow. I minimized his problem as follows:
```coq
Lemma test_no_stack_overflow p n :
get n (pretty (N.pos p)) ≠ Some "_"%char →
get (S n) ("-" +:+ pretty (N.pos p)) ≠ Some "_"%char.
Proof. intros Hlem. apply Hlem. (* stack overflow *) Qed.
```
The problem is that Coq's conversion unfolds too much, and triggers the `wf_guard 32` in:
```coq
Definition pretty_N_go (x : N) : string → string :=
pretty_N_go_help x (wf_guard 32 N.lt_wf_0 x).
```
The `wf_guard` is needed to make sure that computation of `pretty n` for concrete numbers `n` works (see tests in `tests/pretty.v`). However, due to concrete number 32, which adds `2 ^ n` `Acc_intro` constructors to the opaque accessibility proof `N.lt_wf_0` for the well-founded recursion, Coq's conversion might unfold `wf_guard 32` too eagerly.
I hence changed the `32` into `S (N.size_nat x)`, which causes the tests in `tests/pretty.v` to still work, and the stack overflow to disappear. The key idea is that `S (N.size_nat x)` is not a concrete number if `x` is an open term, thus preventing `wf_guard` from unfolding.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/285add {fst,snd}_map_zip2021-06-27T11:25:50ZRalf Jungjung@mpi-sws.orgadd {fst,snd}_map_zipLemmas and proofs by @msammlerLemmas and proofs by @msammlerhttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/284Add a few set and map related lemmas2021-06-25T10:08:08ZSimon Friis VindumAdd a few set and map related lemmasTodo
- [x] Update changelogTodo
- [x] Update changeloghttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/283Rewrite cross split lemmas so they can more easily be used for forward reason...2021-06-18T13:29:51ZRobbert KrebbersRewrite cross split lemmas so they can more easily be used for forward reasoning.Before our cross split lemmas looked like (we have such lemmas for Permutation, Qp, and maps):
```coq
la ++ lb ≡ₚ l →
lc ++ ld ≡ₚ l →
∃ lac lad lbc lbd,
lac ++ lad ≡ₚ la ∧ lbc ++ lbd ≡ₚ lb ∧ lac ++ lbc ≡ₚ lc ∧ lad ++ lbd ≡ₚ ld...Before our cross split lemmas looked like (we have such lemmas for Permutation, Qp, and maps):
```coq
la ++ lb ≡ₚ l →
lc ++ ld ≡ₚ l →
∃ lac lad lbc lbd,
lac ++ lad ≡ₚ la ∧ lbc ++ lbd ≡ₚ lb ∧ lac ++ lbc ≡ₚ lc ∧ lad ++ lbd ≡ₚ ld.
```
This MR changes them to look like:
```coq
la ++ lb ≡ₚ lc ++ ld →
∃ lac lad lbc lbd,
lac ++ lad ≡ₚ la ∧ lbc ++ lbd ≡ₚ lb ∧ lac ++ lbc ≡ₚ lc ∧ lad ++ lbd ≡ₚ ld.
```
The explicit `l` in the old lemma statement was rather annoying. First, it made the proof longer (we immediately substituted it). Second, it made the lemma harder to use because you cannot use it with `apply .. in ..` or the `%` introduction pattern. Example in Iron that shows that the new lemma is easier:
```diff
diff --git a/theories/iron_logic/iron.v b/theories/iron_logic/iron.v
index 2723897..f8864da 100644
--- a/theories/iron_logic/iron.v
+++ b/theories/iron_logic/iron.v
@@ -171,8 +171,7 @@ Proof.
rewrite /Uniform=> HP1 HP2 π1 π2. rewrite !fracPred_at_sep. apply (anti_symm _).
- apply bi.exist_elim=> -[π1'|]; apply bi.exist_elim=> -[π2'|];
apply bi.pure_elim_l; rewrite ?(inj_iff Some) //.
- + intros. destruct (Qp_cross_split (π1 + π2) π1 π2 π1' π2')
- as (π'&π''&π'''&π''''&<-&<-&<-&<-)=> //.
+ + intros (π'&π''&π'''&π''''&<-&<-&<-&<-)%Qp_cross_split.
```https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/282Add lemmas `map_intersection_filter` and `map_difference_filter`.2021-06-17T14:31:41ZRobbert KrebbersAdd lemmas `map_intersection_filter` and `map_difference_filter`.See also the discussion in https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/697/diffs#note_69805See also the discussion in https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/697/diffs#note_69805