change IntoVal so that it is easier to use in specs
-
Interestingly, this change (or rather, https://gitlab.mpi-sws.org/FP/iris-coq/compare/a2dab2fb4959...a4731f4c73b5) made
atomic_heap.v
andpar.v
almost double their compile time:Zooming out shows that this is consistent and not just noise.
However,
heap_lang/lifting.v
(which usesIntoVal
much more often!) is unaffected. What?!?Edited by Ralf Jung -
In the case of
par
, we are basically performing a rewrite on:IntoVal e (f1,f2)
this thing is not directly an equality, so Coq's rewrite (which is used by the
<-
introduction pattern) somehow first tries to see if it can use this thing as a setoid relation.If you enable
Typeclasses eauto := debug
, so see its awful attempt.Edited by Robbert Krebbers -
Here's the slow TC trace: https://gitlab.mpi-sws.org/snippets/173
The fast one doesn't even trigger TC search.
-
Except that that work is already done.
There are surely developments by other people that have not been ported.
Edited by Robbert Krebbers -
IntoVal
doesn't even appear in that TC trace so I am wondering what the heck it is doing.The problem is, I think, that only
IntoVal e (f1,f2)
can be turned into a relation on the same type, namelyλ v1 v2, IntoVal e (v1, v2)
, whereas for the others, that is not the case.I don't think so,
atomic_heap
also got slower and it only usesIntoVal e v
. -
On the other hand, it is looking for something about
rtc
?!???4.1-1.2-2.1-1.1-3.1-2 : (subrelation (bi_entails ==> bi_entails)%signature (rtc ?Goal0 --> flip ?r)%signature)
EDIT: Ah, here
Debug: 1.1-1.3-1.1-1.1-1 : (Reflexive ?r) Debug: 1.1-1.3-1.1-1.1-1: looking for (Reflexive ?r) with backtracking Debug: 1.1-1.3-1.1-1.1-1.1: simple apply @rtc_reflexive on (Reflexive ?r), 0 subgoal(s)
Should
Reflexive
have aHint Mode
?Edited by Ralf Jung -
Ouch, but there is a use of
setoid_rewrite
which fails with that mode. Wtf.EDIT: That
setoid_rewrite
indeed usesrtc
for some intermediate result... that's probably discarded again later. That doesn't seem right.Edited by Ralf Jung -
Interestingly,
Remove Hints rtc_reflexive : typeclass_instances.
also reduces the time to 0.4s. It then picks
iff_reflexive
instead which doesn't introduce a new evar, which seems to help. It may be worth reducing the priority ofrtc_reflexive
, not just for this case.Edited by Ralf Jung -
https://gitlab.mpi-sws.org/robbertkrebbers/coq-stdpp/merge_requests/38 decreased the time the rewrite takes from 2s to 0.38s.