Stronger `iNext` that performs arithmetic cancelation
This is WIP that fixes issue #148 (closed). Some questions:
-
Where to put the canceler. Is this something more generic that should be moved to stdpp? -
Move TCIf
to stdpp. -
How to name MakeIntoLaterN
, it's likeMakeLaterN
, which is used for framing but slightly different, e.g. it does not turn▷ True
intoTrue
, but turns▷^0 P
intoP
and▷^1 P
into▷ P
.
Merge request reports
Activity
added 3 commits
- e2439195 - A simple canceler for natural numbers.
-
0ed18963 - Stronger
iNext
that performs arithmetic cancelation. - 32a8c549 - Test cases for issue #148 (closed).
-
MakeLaterN
is used for framing, and turns▷ True
intoTrue
. That is basically to make sure that when everything under a later has been framed away, the later disappears too. -
MakeIntoLaterN
is used byiNext
and turns▷^0 P
intoP
and▷^1 P
into▷ P
. The is needed to make sure that after canceling in▷^n
we get back something nice.
Obviously, we could merge both classes, but I don't think that is nice. It makes little sense if framing would turn
▷^1 P
into▷ P
, and vice versa, ifiNext
would turn▷ True
into justTrue
.Note something akin to
MakeIntoLaterN
could also be obtained by callingsimpl
on the result ofiNext
but I don't think we should callsimpl
arbitrarily, as it can change the goal in unexpected ways to the user.Edited by Robbert Krebbers-
- Resolved by Robbert Krebbers
I think I am going to move
NatCancel
to std++.Makes sense.
It makes little sense if framing would turn
▷^1 P
into▷ P
, and vice versa, ifiNext
would turn▷ True
into justTrue
.Of course
iNext
should turn a hypothesis\later X
intoX
for anyX
, includingTrue
... I am confused.Where does framing have to turn things into
LaterN
anyway?I suggest the version that does some sort of
simpl
should haveSimpl
in its name. Also, both typeclasses should have documentation saying what they are supposed to do and what not, Other than that, if you feel two typeclasses are needed, sure, go for it. :)I think I am going to move
NatCancel
to std++.See https://gitlab.mpi-sws.org/robbertkrebbers/coq-stdpp/merge_requests/26/diffs
iNext
on a goal with a single▷
should not turn▷^(S n) True
intoTrue
.Ah. Well, I wouldn't mind that strongly.
framing
P
in▷^n P ∗ Q
should turn the goal intoQ
.Why does this need anything smart? Just descent below later and later^n ?
Edited by Ralf Jungadded 16 commits
-
32a8c549...4ffff895 - 14 commits from branch
master
-
0414149c - Stronger
iNext
that performs arithmetic cancelation. - d7041e5a - Test cases for issue #148 (closed).
-
32a8c549...4ffff895 - 14 commits from branch
framing
P
in▷^n P ∗ Q
should turn the goal intoQ
.Why does this need anything smart? Just descent below later and later^n ?
The problem is that depending on whether framing in
P
succeeds, we need to get rid of the later▷^n
.That's why we don't have:
Global Instance frame_laterN p n R R' P Q : NoBackTrack (IntoLaterN n R' R) → Frame p R P Q → Frame p R' (▷^n P) (▷^n Q).
But rather this whole
MakeLaterN
business.