Skip to content
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

Open
jonsterling opened this issue Jan 29, 2016 · 7 comments
Open

add explicit substitutions #29

jonsterling opened this issue Jan 29, 2016 · 7 comments

Comments

@jonsterling
Copy link
Collaborator

let's add a new constructor for explicit substitutions! And we can also add some operations to wring out the substitutions.

@freebroccolo

@jozefg
Copy link
Collaborator

jozefg commented Jan 29, 2016

Oh nice, very Twelf-y :)

@jonsterling
Copy link
Collaborator Author

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

@jozefg
Copy link
Collaborator

jozefg commented Jan 29, 2016

Sounds cool! I'm curious how this plays out!

@ghost
Copy link

ghost commented Jan 29, 2016

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

  • A partial implementation of the K-sigma machine (described here: https://ifl2014.github.io/submissions/ifl2014_submission_17.pdf). The idea is that it uses a zipper based approach on top of the Krivine machine to handle full normalization, IIRC. Been awhile since I looked at it but I remember thinking it was a nice idea.

https://github.com/freebroccolo/K-sigma-machine/blob/master/src/Machine.ml

@ghost
Copy link

ghost commented Jan 29, 2016

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.

@jonsterling
Copy link
Collaborator Author

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.

@ghost
Copy link

ghost commented Sep 23, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants