yacctt icon indicating copy to clipboard operation
yacctt copied to clipboard

Is there a general way to derive these computation rules?

Open ice1000 opened this issue 4 years ago • 6 comments
trafficstars

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?

ice1000 avatar Oct 11 '21 19:10 ice1000

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

mortberg avatar Oct 11 '21 19:10 mortberg

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 :-)

mortberg avatar Oct 11 '21 19:10 mortberg

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?

ice1000 avatar Oct 12 '21 01:10 ice1000

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.

ice1000 avatar Oct 12 '21 01:10 ice1000

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.)

mortberg avatar Oct 12 '21 05:10 mortberg

Thanks for the clarification, I think my friend told me about coe, and I was asking about hcom.

ice1000 avatar Oct 12 '21 21:10 ice1000