We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1642942 commit 7e04484Copy full SHA for 7e04484
nltk/inference/resolution.py
@@ -141,13 +141,13 @@ def find_answers(self, verbose=False):
141
answers = set()
142
answer_ex = VariableExpression(Variable(ResolutionProver.ANSWER_KEY))
143
for clause in self._clauses:
144
- for term in clause:
145
- if (
146
- isinstance(term, ApplicationExpression)
147
- and term.function == answer_ex
148
- and not isinstance(term.argument, IndividualVariableExpression)
149
- ):
150
- answers.add(term.argument)
+ if (
+ len(clause) == 1
+ and isinstance(clause[0], ApplicationExpression)
+ and clause[0].function == answer_ex
+ and not isinstance(clause[0].argument, IndividualVariableExpression)
+ ):
+ answers.add(clause[0].argument)
151
return answers
152
153
@staticmethod
0 commit comments