Closed linas closed 8 years ago
In this case the instantiator is evaluating following solution during pattern matching:
(EqualLink (stv 1,000000 0,000000)
(BindLink (stv 1,000000 0,000000)
(AndLink (stv 1,000000 0,000000)
(VariableNode "$lnk") ; [9]
(EvaluationLink (stv 1,000000 0,000000)
(VariableNode "$a") ; [10]
(VariableNode "$b") ; [11]
) ; [18446744073709551615]
(EqualLink (stv 1,000000 0,000000)
(VariableNode "$lnk") ; [9]
(EvaluationLink (stv 1,000000 0,000000)
(VariableNode "$a") ; [10]
(VariableNode "$b") ; [11]
) ; [18446744073709551615]
) ; [18446744073709551615]
) ; [18446744073709551615]
(VariableNode "$lnk") ; [9]
) ; [18446744073709551615]
(EvaluationLink (stv 1,000000 0,000000)
(ConceptNode "glib") ; [6]
(ConceptNode "blab") ; [7]
) ; [18446744073709551615]
) ; [18446744073709551615]
When the type restrictions are enabled this solution is pruned earlier. Also when my previous fix #243 is merged this solution is pruned because the fix does not allow to ground variable $lnk by atom containing $lnk as it is in this situation.
The exception is caused by constructor of BindLink atom above during validation of its clauses. I have checked deeper and it turned out that some FindUtils methods do not support searching of the atom tree which is not in the atomspace yet. I will send small fix for that. The strange max int numbers above are due to optimisation in the instantiator which creates new atom tree, but instantiate it in the atomspace at the end only.
Thanks!
I am interested in getting as much of the infrastructure as possible to work correctly, even if atoms are not in the atomspace. So yes, please send a FindUtils fix if you have one!
This is closely related to #211 and also pull req #244 affects this.
What about https://github.com/opencog/atomspace/issues/172? The BindLink constructor exception is the same one right?
I just tried #172 and it seems to work for me.
Reopening this as well, since it's the exact same issue as #172 (trying to create BindLink in _temp_aspace
for evaluatable). The fact it doesn't crash anymore is just a side effect of those functions in FindUtils always return true.
Hah?? If it doesn't crash any more, then what is the issue? This particular bug is fixed; if you have a new bug, open a new bug report and describe that bug.
The following throws an exception, which is not expected:
It does not throw when the VariableList is uncommented, so that the type restrictions are enforced. This is unexpected, because both versions should return the same answer, although the version with the type declarations should run faster, as it prunes some un-needed searches.