-
Notifications
You must be signed in to change notification settings - Fork 242
Automatic alpha-conversion during pattern matching #2070
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
Comments
I don't see how this has anything to do with alpha conversion, since nothing in the search pattern is forcing the variable names to match. It's just looking for two bodies -- those should be findable, and then after that (after finding them) it looks for what is attached to the bodies -- which should be the variable declarations, whatever they may be, converted or not. What am I missing? |
Ohh, I see, the bodies cannot match up. Hmmm. |
OK, why are the quotes needed? Would it be OK to search, without the quotes? |
So I poked around just for a bit. I notice that this simpler quote-less search also fails:
I can't think of any good reason why it should fail. Maybe there is a reason, but I don't remember why. Anyway, either with, or without quotes, this does indeed seem like a bug. |
The q3 above fails because of line 303 in |
OK, so pull req #2071 seems to be a necessary pre-req for fixing this problem. I understand why this is failing. I'm pondering a solution. |
I see two possible solutions. One is to create a new link type, that doesn't exist yet, called
I think that would work. I haven't tried it yet. Its not terribly efficient, as its potentially a combinatorial explosion. But really no different than queiries with The other solution is to automatically do something kind-of-like the above, but hidden inside the pattern matcher. This ... I kind-of don't like it because its hard to implement in a general way, and would make the pattern matcher even more complex than it already is ... I'm gonna try the |
@ngeiswei , to understand the issue better (as at the first glance I also could not find how it is related to alpha conversion): Am I right that issue is if one creates |
@vsbogd, I think it's deeper than that. A scope link should virtually (using @linas terminology) exists in all its alpha converted forms, and so if we ask the pattern matcher to fetch scope links such that one them should be alpha-converted to match the constraints of the query, the pattern matcher should do it on-the-fly. It seems to me the only/best way to fulfill the query provided in that example, the same scope link is matched twice, but with a different variable name in order to match the body conjunct of the conjunction scope link. |
At this time,
Not sure what do do here. for now it seems liem q6 is a reasonable work-around. Automated alpha equivalence could be done, I suppose, but I also want to see this is a special and unusual case of #554. Leaving open for now. |
The following
attempts to grab a pattern, lambda link of 2 conjuncts, only if each conjunct is also a pattern (wrapped in a
LambdaLink
as well), for instance, given the KBWe would expect to get
but instead get nothing.
It is explained by the fact that
The text was updated successfully, but these errors were encountered: