-
Notifications
You must be signed in to change notification settings - Fork 19
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
Variable confusion/ill typed terms with higher-order terms #155
Comments
Looks like an issue with imitation in the unification engine. Simpler test case:
This is probably also a soundness bug. |
I played with the unification bug a bit, trying to get Abella to use it to prove false. I didn't manage that (yet), but I did get Abella to generate a "naked OCaml exception". Maybe this helps in debugging efforts. I'm using Abella 2.0.8.
|
The incorrect binding |
Yeah, I think that precondition is for the variable being substituted for, not about bound variables. Anyway, I think I have an idea of what is causing this bug, but I don't yet know how to fix it. The problem comes from lines 395-396 of unify.ml, which is something that was added during the polymorphism branch merge. If those lines are commented, the non-pattern unification problem is left unsolved, which is still not ideal but is at least sound. |
Isn't it suspicious that |
Possible fix for #155. More testing needed.
Hmm. Interesting. I've just committed your suggestion. It looks possible as the source of the issue, but this leaves me very puzzled. This is touching some ancient parts of Abella which date back to when Andrew took Gopalan's original unification code from his "Practical Higher-Order Pattern Unification With On-the-Fly Raising" paper. I'll have to do a closer read to see if indeed this was a bug in translating from SML to OCaml or from somewhere else (or indeed if it's the source of the bug at all). Thanks again! |
@gnadathur97 This bug report and discussion may be of interest to you. |
Just some notes. Compare the calls (in the broken code) between good and bad cases:
In the good case, we have a toplevel expansion which adds the The |
I think I found another weird case (isn't fixed by 38fda7a)
results in
I'd expect
|
This looks fine to me. Your intended full instance is:
However, the error message makes it clear why this cannot be allowed:
In effect, when you |
Closing as fixed for now. If you find anything else, please comment and I'll reopen. Thanks again. |
Script:
Output:
Expected:
That is, instead of
n1 : expr
we havek_ : expr -> expr
.The motivation is the third-order representation of λμ-calculus.
foo
takes a μ-term and performs structural substitution with the empty continuation under the binder, making the continuation variable unused.The text was updated successfully, but these errors were encountered: