-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add explicit substitutions #29
Comments
Oh nice, very Twelf-y :) |
@jozefg Yeah, was chatting with Darin about it last night and he finally got it through my thick head what they did! 😄 Based on some of the Pfenning & Pientka stuff, I had got the mistaken impression that explicit substitutions have anything at all to do with meta-variables, but in fact they are totally orthogonal. It's just this cute left kan extension trick for suspended bind that you see all the time in Haskell... I think it would be cool to add them, since we can then implement some nice abstract machine stuff pretty easily. |
Sounds cool! I'm curious how this plays out! |
Sounds like a good plan. Here are some links that may be useful for implementation purposes:
https://github.com/freebroccolo/substitutions/blob/master/src/Krivine.ml#L28-L58 and https://github.com/freebroccolo/substitutions/blob/master/src/Krivine.ml#L341-L388
https://github.com/freebroccolo/K-sigma-machine/blob/master/src/Machine.ml |
I should also mention that the defunctionalized representation for these substitutions is a bit like the order-preserving embeddings (OPE) stuff that Chapman and co use in some of their papers. |
Getting closer to the point where I will almost certainly want to have these. At this point, there is basically one question remaining, which is how to decide alpha equivalence for explicit substitution terms—this is clearly possible, but it may be a bit difficult to define (the coend induces a non-discrete equality for closures). I guess one dumb way to define it would be to just force the closure when we get to one. |
I think Abel gives an algorithm in a few places. Maybe in his habilitation thesis. One approach that I think might work would be to compute and store the strengthening of the head term and environment (deduped) in the closure as soon as the closure is created. This way, you could quickly check that the lengths of the environments for the two closures match before doing anything else. If they match, then you would check that one is a permutation of the other. After that, it should be straightforward. |
let's add a new constructor for explicit substitutions! And we can also add some operations to wring out the substitutions.
@freebroccolo
The text was updated successfully, but these errors were encountered: