yacctt
yacctt copied to clipboard
Is there a general way to derive these computation rules?
I saw https://github.com/mortberg/yacctt/blob/72cf5472764f89c1c978c72fb75f9b938dc17465/Eval.hs#L428-L433
Is it that you are too lazy to implement the general case, or is it an open problem?
We were just too lazy. One can introduce a special universe of types where coe computes like the identity function. I think one of the RedPRL/redtt/cooltt implementations did this, but I don't remember which or how it worked in detail... @favonia @jonsterling @cangiuli
Btw, with this hack it's obviously easy to do bad things. Just have a type with parameters called "S1" and make some coercion that shouldn't compute like the identity. However, as we don't have a termination checker it's already trivial to prove false so we didn't consider this too bad. Plus the only intended users of yacctt were the developers who knew about all of the hacks :-)
Nice, thanks! In what case would hcom on HIT compute like an id function? My current understanding is that hcom on HIT is mostly canonical and sometimes reducible as id, am I right?
A friend told me it's when your type is not parameterized, but I actually don't quite understand why it works this way. I guess I'll need to read some papers.
A friend told me it's when your type is not parameterized, but I actually don't quite understand why it works this way. I guess I'll need to read some papers.
Are you talking about hcom or coe? For coe this is correct, for hcom it's not. My recommendation is not to just read some papers, but to try to check this yourself on paper. (Hint: think about a universe U.)
Thanks for the clarification, I think my friend told me about coe, and I was asking about hcom.