Closed williampma closed 8 years ago
Hmm, that is the the intended behavior. Rather than trying to fix this, we should check to see that all variablees appear somewhere, where they can be grounded, and throw an error when this is not the case.
(The alternative is just to try every-possible grounding for the thing, which is yucky, in part because such a search space can be huge. Despite your good example, I'm tempted to say that such implicit behavior s not what most users would desire...)
Perhaps I was unclear. The pattern B is an invalid pattern, and so this is a user error. The Variable $C never appears in any term where it would result in it's being grounded. Thus, $C has no grounding, the EqualLink will always evaluate to false, and thus, you get no result back. What should have happened is that an error is thrown: the $C never appears in any non-evaluatable clause. This would at least let you know the expression is ill-formed.
I just pushed an explicit check for a very similar fix, in pull request #247.
Ooops, I take that back. #247 does explicitly throw an error if you try to define B like the above. Clsoing, please re-open if you disagree/dislike this ...
Very related to https://github.com/opencog/atomspace/issues/165 as it passes through the same code path to check whether to Pattern Match.
If the evaluatable contains a variable that is not in common with any of the other non-evalutable clause, it cannot solve it. This is because Pattern Matcher tries to solve the non-virtual clause first, then use the mapping to evaluate the virtual, so the variables that are unique to the virtual clause is not grounded.