File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -535,11 +535,15 @@ if <$op is executable grounded atom>:
535535 case IncorrectArgument:
536536 return [($atom, $bindings)]
537537else:
538- for $rb in query($space, (= $atom $X)):
539- for $mb in merge_bindings($rb, $bindings):
540- if not(<$mb has loop bindings>) and <$mb contains value for the $X variable>:
541- $x = <get value of the $X variable from $mb>
542- $results += [metta($x, $type, $space, $mb)]
538+ $query_output = query($space, (= $atom $X))
539+ if len($query_output) > 0:
540+ for $rb in $query_output:
541+ for $mb in merge_bindings($rb, $bindings):
542+ if not(<$mb has loop bindings>) and <$mb contains value for the $X variable>:
543+ $x = <get value of the $X variable from $mb>
544+ $results += [metta($x, $type, $space, $mb)]
545+ else:
546+ $results += [($atom, $bindings)]
543547
544548if len($results) == 0:
545549 return [(Empty, $bindings)]
You can’t perform that action at this time.
0 commit comments