stdpp merge requestshttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests2023-09-21T14:41:01Zhttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/505Generalize some map/finset results from `Set_` to `SemiSet`.2023-09-21T14:41:01ZRobbert KrebbersGeneralize some map/finset results from `Set_` to `SemiSet`.I noticed this while reviewing !459I noticed this while reviewing !459https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/504Revert "Merge branch 'janno/tc-opaque-unseal' into 'master'"2023-09-11T14:51:34ZRalf Jungjung@mpi-sws.orgRevert "Merge branch 'janno/tc-opaque-unseal' into 'master'"This reverts merge request !487. It broke the Iris build:
```
File "./iris/base_logic/lib/ghost_var.v", line 119, characters 9-32:
Error: Could not fill dependent hole in "apply"
File "./iris/base_logic/lib/gen_heap.v", line 194, charac...This reverts merge request !487. It broke the Iris build:
```
File "./iris/base_logic/lib/ghost_var.v", line 119, characters 9-32:
Error: Could not fill dependent hole in "apply"
File "./iris/base_logic/lib/gen_heap.v", line 194, characters 9-32:
Error: Could not fill dependent hole in "apply"
```https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/503Add missing Bind Scope for fin2023-09-21T13:49:16ZThibaut PéramiAdd missing Bind Scope for finThis allows for automatic declaration of fin_scope when in a function argument of type `fin n`. For example in a defined function `f {n}: fin n → T`, you can now do `f 45` instead of `f 45%fin` (assuming the `n` can be deduced of course)...This allows for automatic declaration of fin_scope when in a function argument of type `fin n`. For example in a defined function `f {n}: fin n → T`, you can now do `f 45` instead of `f 45%fin` (assuming the `n` can be deduced of course). This might be a breaking change in very weird circumstances, but it otherwise allows a more convenient use of the fin notations.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/502More efficient `encode`/`decode` for `string`/`ascii`2023-09-05T12:21:02ZRobbert KrebbersMore efficient `encode`/`decode` for `string`/`ascii`When experimenting with the benchmarks in https://github.com/xavierleroy/canonical-binary-tries I noticed that our `encode` function for `Countable` of `string` is slow: it creates a `list` for each char which is then converted to a `pos...When experimenting with the benchmarks in https://github.com/xavierleroy/canonical-binary-tries I noticed that our `encode` function for `Countable` of `string` is slow: it creates a `list` for each char which is then converted to a `positive` and appended to the result.
https://github.com/xavierleroy/canonical-binary-tries/blob/v2/lib/String2pos.v contains a better version, which I have adapted to std++ style. (That repository is BSD licensed so we can use it, our comment contains a link to give credit, of course.).
I also changed the coding of `ascii` by reusing the one for `string`; this one is also faster as the benchmark below shows.
~~The `decode` function still converts to `list`, but I don't know how to avoid that without writing 2^8 = 256 cases.~~
```
From stdpp Require Import strings countable.
Import Ascii.
Definition long := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod aliquam dui, non ultrices nisl rhoncus pretium. Donec tristique at diam eget commodo. Ut elit diam, maximus ac metus at, commodo malesuada diam. Morbi vehicula tortor et mauris malesuada, ac congue mauris ultrices. Donec id faucibus tellus. Vestibulum vulputate molestie urna, in sagittis tortor. Pellentesque placerat orci ut velit mattis consectetur. Mauris non nulla sit amet nisi egestas pellentesque. Aenean tincidunt id leo et placerat. Nam fermentum lectus sit amet pretium egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit.".
Time Eval vm_compute in Pos.iter (λ s, default "" $ decode (encode s)) long 10000.
(* old: 4.759s *)
(* new encode: 1.876s *)
(* new encode/decode: 0.916s *)
Time Eval vm_compute in (Pos.iter (λ s, default "b" $ decode (encode s)) "a" 1000000)%char.
(* old: 2.636s *)
(* new encode: 0.493s *)
(* newer encode/decode: 0.308s *)
```https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/500explain why we don't have 'ge' notation2023-08-30T12:15:38ZRalf Jungjung@mpi-sws.orgexplain why we don't have 'ge' notationThis came up in https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/499This came up in https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/499https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/498Change Hint Mode of LeibnizEquiv2023-08-28T15:42:45ZIke MulderChange Hint Mode of LeibnizEquivAs discussed in iris!966, the `LeibnizEquiv` typeclass currently has `Hint Mode ! -`, signifying that the type is an input, while the equivalence which is supposed to imply leibniz equality is an output. That should be `Hint Mode ! !`, i...As discussed in iris!966, the `LeibnizEquiv` typeclass currently has `Hint Mode ! -`, signifying that the type is an input, while the equivalence which is supposed to imply leibniz equality is an output. That should be `Hint Mode ! !`, i.e., both are inputs.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/497use ssreflect rewrite for multiset tactics2023-11-25T09:59:44ZRalf Jungjung@mpi-sws.orguse ssreflect rewrite for multiset tacticsFixes https://gitlab.mpi-sws.org/iris/stdpp/-/issues/195
Unfortunately I don't know how to condense this into a testcase, the issue needs canonical structure shenanigans to occur.Fixes https://gitlab.mpi-sws.org/iris/stdpp/-/issues/195
Unfortunately I don't know how to condense this into a testcase, the issue needs canonical structure shenanigans to occur.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/496prove general fmap_inj lemmas2023-10-06T09:36:54ZRalf Jungjung@mpi-sws.orgprove general fmap_inj lemmasand derive the existing ones from it (and also in Iris, an equivalent one for `dist`)and derive the existing ones from it (and also in Iris, an equivalent one for `dist`)https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/495solve_proper: add support for subrelation2023-10-13T16:19:48ZRalf Jungjung@mpi-sws.orgsolve_proper: add support for subrelationI realized that solve_proper cannot currently prove things like `NonExpansive (λ x, ⌜a = x⌝)`, which is a bit of a bummer. So this adds the infrastructure required to make that work.I realized that solve_proper cannot currently prove things like `NonExpansive (λ x, ⌜a = x⌝)`, which is a bit of a bummer. So this adds the infrastructure required to make that work.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/494Correct `Params` instances for `lookup` and `singletonM`.2023-08-03T13:11:04ZRobbert KrebbersCorrect `Params` instances for `lookup` and `singletonM`.We always use Leibniz keys (`nat` for list, `Countable` for maps), so the `Params` should be one higher.
In fact, for `singletonM` and `insert` we already use the correct number for `Params`.We always use Leibniz keys (`nat` for list, `Countable` for maps), so the `Params` should be one higher.
In fact, for `singletonM` and `insert` we already use the correct number for `Params`.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/493Better way of writing `Proper` premises in fin sets2023-08-03T13:01:11ZRobbert KrebbersBetter way of writing `Proper` premises in fin setsUse `Proper (.. => impl)` instead of `Proper (.. => iff)` and `∀ x, Proper ..` instead of `Proper ((=) ==> ..)`.
The new premises are easier to prove (both `solve_proper` and manual proof).
This came up in https://gitlab.mpi-sws.org/ir...Use `Proper (.. => impl)` instead of `Proper (.. => iff)` and `∀ x, Proper ..` instead of `Proper ((=) ==> ..)`.
The new premises are easier to prove (both `solve_proper` and manual proof).
This came up in https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/478https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/492Change premise `Equivalence` into `PreOrder` for `set_fold_proper`.2023-08-02T11:16:48ZRobbert KrebbersChange premise `Equivalence` into `PreOrder` for `set_fold_proper`.Factored out of https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/478Factored out of https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/478https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/491Add a number of missing intersection lemmas2023-08-02T09:47:49ZMarijn van Wezelmarijn.vanwezel@ru.nlAdd a number of missing intersection lemmasThis pull request adds a number of missing lemmas about the intersection on options (closes #166). The `lookup_intersection` lemma was added in !466.This pull request adds a number of missing lemmas about the intersection on options (closes #166). The `lookup_intersection` lemma was added in !466.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/490add pair_equiv2023-08-03T13:03:49ZRalf Jungjung@mpi-sws.orgadd pair_equivWhen having `H: (a1, b1) ≡ (a2, b2)`, it's actually rather annoying to rewrite an `a1` in the goal:
```
destruct H as [H _]; simpl in H; rewrite H
```
This is because destructing `H` yields `(a1, b1).1 ≡ (a2, b2).1`.
So a lemma like thi...When having `H: (a1, b1) ≡ (a2, b2)`, it's actually rather annoying to rewrite an `a1` in the goal:
```
destruct H as [H _]; simpl in H; rewrite H
```
This is because destructing `H` yields `(a1, b1).1 ≡ (a2, b2).1`.
So a lemma like this could be useful, then we should be able to do `apply pair_equiv in H as [-> _]`.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/489add some map-fmap lemmas2023-08-02T21:22:21ZRalf Jungjung@mpi-sws.orgadd some map-fmap lemmashttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/487Make `unseal` TC opaque2023-09-11T14:46:09ZJannoMake `unseal` TC opaqueThis had a very slight positive impact on our development. But we don't have a lot of things sealed this way so the impact might be bigger in other developments.This had a very slight positive impact on our development. But we don't have a lot of things sealed this way so the impact might be bigger in other developments.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/486Remove Permutation Proper workaround that is not needed in Coq >= 8.15.2023-07-25T10:11:14ZRobbert KrebbersRemove Permutation Proper workaround that is not needed in Coq >= 8.15.Fixed by https://github.com/coq/coq/issues/14571
I checked that the test cases in https://gitlab.mpi-sws.org/iris/stdpp/-/issues/114 still succeed instantly after removing the workaround.Fixed by https://github.com/coq/coq/issues/14571
I checked that the test cases in https://gitlab.mpi-sws.org/iris/stdpp/-/issues/114 still succeed instantly after removing the workaround.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/485Add bitvector number notations2023-09-01T06:47:50ZThibaut PéramiAdd bitvector number notationsThis adds number notations into bv_scope that expand to `Z_to_bv _ {number}`.
This notation is parsing only, printing will print the full `Z_to_bv` call.
Also the bitvector is not computed: The term `4%bv` is literally of the shape
`(Z_t...This adds number notations into bv_scope that expand to `Z_to_bv _ {number}`.
This notation is parsing only, printing will print the full `Z_to_bv` call.
Also the bitvector is not computed: The term `4%bv` is literally of the shape
`(Z_to_bv _ 4)`, it is NOT evaluated to a shape of `BV _ 4 _`. On the other hand
this allows to write `((-1)%bv : bv 32)` to get something that reduces to
`BV 32 0xFFFFFFFF`.https://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/484Add fin notations2023-07-21T10:38:44ZThibaut PéramiAdd fin notationsIn my own project, I need fin notation up to 32, but I added them up to 50 here. I put the Python script in a comment so that people can tweak it and re-run it for a larger number if needed.
EDIT: Now support all numbers using Coq's Num...In my own project, I need fin notation up to 32, but I added them up to 50 here. I put the Python script in a comment so that people can tweak it and re-run it for a larger number if needed.
EDIT: Now support all numbers using Coq's Number Notationhttps://gitlab.mpi-sws.org/iris/stdpp/-/merge_requests/483Remove FIXME in `fin_map_dom`.2023-06-02T15:59:15ZRobbert KrebbersRemove FIXME in `fin_map_dom`.Let's see if CI agrees with me.Let's see if CI agrees with me.