Add mode for Dist
Merge request reports
Activity
mentioned in merge request !696 (merged)
added 3 commits
-
9c26f76a...07ab4060 - 2 commits from branch
iris:master
- 2b3d5721 - Mode for Dist
-
9c26f76a...07ab4060 - 2 commits from branch
@jung The next step (if/when you want) is to run reverse CI against this branch, right?
- Resolved by Paolo G. Giarrusso
It's a one-line command to run these tests, so -- sure. ;)
mentioned in merge request !701 (merged)
I have some mixed feelings about this.
One the one hand, due to the Coq bug, this means that some strange unexpected type annotations are needed in client code. One could imagine similar statements from !701 (diffs) involving
dist
. That said, CI shows we're not doing writing such statements in practice. Also,dist
not used that much, aside from writingNonExpansive
instances, for defining custom camaras, and for hacking in the model.So, question here: does the benefit of the
Hint Mode
outweigh the issues?I slightly think it does.
- Resolved by Paolo G. Giarrusso
"The Coq bug" being https://github.com/coq/coq/issues/14441, I assume? It's always good to add some links for people reading this in the future. ;)
Edited by Ralf Jung
I don't have a clear feeling for it either (there's also no response from the Coq team yet, so we don't know what's the cause).
I tried to cook up a similar example for
dist
as we have forequiv
in https://github.com/coq/coq/issues/14441 It turns out the version fordist
just works. It looks like the interaction between type classes and canonical structures is somehow in our favor here?From iris.algebra Require Import list. Global Hint Mode Dist ! : typeclass_instances. (* succeeds *) Lemma list_dist_lookup {A : ofe} n (l1 l2 : list A) : l1 ≡{n}≡ l2 ↔ ∀ i, l1 !! i ≡{n}≡ l2 !! i. Abort. Global Hint Mode Equiv ! : typeclass_instances. (* succeeds *) Lemma list_equiv_lookup {A : ofe} (l1 l2 : list A) : l1 ≡ l2 ↔ ∀ i, l1 !! i ≡ l2 !! i. Abort. (* fails *) Lemma list_equiv_lookup `{Equiv A} (l1 l2 : list A) : l1 ≡ l2 ↔ ∀ i, l1 !! i ≡ l2 !! i. Abort.
Edited by Robbert Krebbers- Resolved by Paolo G. Giarrusso
So, I think I am in favor of this MR now, provided we add the example
list_dist_lookup
to the test suite. Then we make sure that if Coq changes, that example remains to work.
added S-waiting-for-author label
- Resolved by Paolo G. Giarrusso
- Resolved by Ralf Jung