-
Notifications
You must be signed in to change notification settings - Fork 235
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
Non monotonic behavior of the pattern matcher with present clauses #2886
Comments
@linas, I'm working on it. However, if you have some idea at the top of your head as to why it fails, that's welcome. |
When I uncomment the following lines atomspace/opencog/query/PatternMatchEngine.cc Lines 2608 to 2611 in 7385233
it no longer fails. |
@linas, since I have a workaround (disabling that negative cache check) and more urgent work to do I'm gonna leave that bug for now and will come back to it after a few days or weeks, unless you fix it by then. |
Caches (on any kind of system) are notoriously hard to make work right. These caches made a huge difference on the bio-agi search patterns (major speedup on multi-minute searches). I'll look. I've got something else I should be doing, but this kind of bug is very irritating. |
BTW, Some off-topic comments but I know you will read them if I post them here.
and then a recursive rule
and the chaining query is
something like that. Details TBD. There is a simplified example of this in Anyway, what happens is the pattern matcher keeps walking the graph, recursing one step deeper, until it runs out of possibilities. Early termination/pruning would have to be done in the rules, because yes, infinite recursion is possible. (In practice, it runs out of temp atomspaces, and throws an exception. Each level of recursion starts a new temp atomspace, aka "kripke frame".) |
Comment about |
I think this is not about caching, I think it's got something to do with quotation. The pattern term tree shows up as FWIW, removing the quotes makes the test run fine. The pattern tree is assembled before any matching is done. So this is not a pattern matcher issue, its a pattern compiler issue. |
BTW, #2889 also happens to fix this bug! Changed my mind, see next comment.
atomspace/opencog/atoms/pattern/PatternLink.cc Lines 1133 to 1138 in 23884b6
|
Changed my mind, and struck out what I wrote above. A minor printing fix does print the term tree correctly. I've merged that printing fix into master already. I inserted an There are two possible fixes: I will look at (2) for a while. Sorry to spam you with all these comments, but ... it seems like recording the debug process is the right thing to do. |
Thanks for fixing this @linas!!! I skimmed through your changes, I understand some but not all of it. I don't have time to look deeper right now so I'm gonna leave it and only get back to it if more problems arise. |
Regarding combining |
Looks like everything works as it should on my end, I think I can close that issue. |
For the record: there were two classes of changes.
What remains TBD:
|
Problem description
I have a query, containing only present clauses, that correctly succeeds. However the presence of an another atom in the atomspace makes it fails.
How to reproduce
Run the following scheme code:
It, incorrectly, returns nothing.
Remove the culprit atom and then it works.
The text was updated successfully, but these errors were encountered: