Use `NoBackTrack` type class for framing with ▷
As shown in #153 (closed) I noticed that uses of iFrame
are pretty slow. The reason for this are the instances:
Global Instance frame_later p R R' P Q Q' :
IntoLaterN 1 R' R →
Frame p R P Q →
MakeLater Q Q' →
Frame p R' (▷ P) Q'.
Global Instance frame_laterN p n R R' P Q Q' :
IntoLaterN n R' R →
Frame p R P Q →
MakeLaterN n Q Q' →
Frame p R' (▷^n P) Q'.
When establishing Frame p R P Q
fails, which is quite often the case when you try to frame something that cannot be framed, type class search will back track like crazy on the various ways it can prove IntoLaterN n R' R
.
So, in this MR I have introduced a class NoBackTrack
which uses a dirty hack to make sure that no backtracking is performed. I then flag these IntoLaterN
using NoBackTrack
and the problem is solved.
On LambdaRust this gives a 17s speedup overall.
Todo
-
Maybe move NoBackTrack
to stdpp?
Merge request reports
Activity
- Resolved by Robbert Krebbers
- Resolved by Robbert Krebbers
When establishing
Frame p R P Q
fails, which is quite often the case when you try to frame something that cannot be framed, type class search will back track like crazy on the various ways it can proveIntoLaterN n R' R
.So it's finding tons of different ways to prove this for the same
R
, and then triedFrame p R P Q
again for each of them?Doesn't it do caching?
That may not always help, and likewise this does not necessarily have to do with proof relevance.
if you consider
n
andR'
to be inputs andR
to be the output ofIntoLaterN n R' R
, then there could be multiple possible outputs, i.e. multiple successes. How would caching help there?Edited by Robbert Krebbersadded 2 commits
- 80a99e7e - Bump stdpp.
-
5e3416d3 - Fix issue #153 (closed) by using
NoBackTrack
in theFrame
instances for ▷.
enabled an automatic merge when the pipeline for 5e3416d3 succeeds
mentioned in commit 4ffff895