add telescopes and a bit of theory about them
I think the basic definitions are pretty solid by now, though I am still fighting with making high-level telescope-based definitions that have nice pretty-printing.
Open question: Telescopes generalize hlists to the dependent case. Should we get rid of hlists? Does anyone want to attempt porting hlist users over to telescopes? Restricting the dependency can actually be useful because it makes them easier to use.
Merge request reports
Activity
added 1 commit
- 27620704 - add telescopes and a bit of theory about them
I have a branch of Iris using these to add telescopic BI binders and proofmode support at https://gitlab.mpi-sws.org/FP/iris-coq/tree/ci/ralf/telescopes (currently that still copies this file, but of course when this gets merged, that copy will be removed).
feel free to try.
I'd rather spend my time on telescopes in logical atomicity TBH. I'm already way behind on that.
Edited by Ralf Jungadded 1 commit
- 0509f5a9 - add telescopes and a bit of theory about them
added 1 commit
- 5e9c82ab - add telescopes and a bit of theory about them
added 1 commit
- 7f827e9a - add telescopes and a bit of theory about them
- Resolved by Ralf Jung
- Resolved by Ralf Jung
- Resolved by Robbert Krebbers
- Resolved by Ralf Jung
- Resolved by Ralf Jung
- Resolved by Ralf Jung
- Resolved by Robbert Krebbers
- Resolved by Robbert Krebbers
- Resolved by Ralf Jung
- Resolved by Ralf Jung
added 1 commit
- f2292a3e - show that tele_app ∘ tele_bind is an identity; remove unused strange fmap instance
- theories/telescopes.v 0 → 100644
95 tele_bind (λ a, F (TargS x a)) 96 end. 97 Arguments tele_bind {_ !_} _ /. 98 99 (* Show that tele_app ∘ tele_bind is the identity. *) 100 Lemma tele_app_bind {U} {TT : tele} (f : TT → U) x : 101 (tele_app $ tele_bind f) x = f x. 102 Proof. Set Printing Coercions. 103 induction TT as [|X b IH]; simpl in *. 104 - rewrite (tele_arg_O_inv x). done. 105 - destruct (tele_arg_S_inv x) as [x' [a' ->]]. simpl. 106 rewrite IH. done. 107 Qed. 108 109 (** A function that looks funny. *) 110 Definition tele_arg_id (TT : tele) : TT -t> TT := tele_bind id. changed this line in version 9 of the diff
- Resolved by Ralf Jung
added 1 commit
- db84c646 - show that tele_app ∘ tele_bind is an identity; remove unused strange fmap instance
- Resolved by Ralf Jung
mentioned in commit 5bcfb8b0
All right, merged.
The Iris side of this depends on https://gitlab.mpi-sws.org/FP/iris-coq/merge_requests/150.
Oh, right, they are used for the arguments of
iSpecialize (foo $! ...)
. Not sure how easy it's to port them, but feel free to try.FYI, you nerdsniped me into briefly trying this. However, Coq's type inference is entirely unable to cope with all the extra freedom it gets when these things can be dependent, so everything falls apart. I don't think we can use telescopes there with the current unification algorithm; maybe after the new one got merged.