Mercurial > code > home > repos > homeauto
changeset 1621:da235054caa0
rename workingSet, sometimes
author | drewp@bigasterisk.com |
---|---|
date | Wed, 08 Sep 2021 18:51:18 -0700 |
parents | 92f8deb59735 |
children | 38bd8ef9ef67 |
files | service/mqtt_to_rdf/inference.py |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference.py Wed Sep 08 18:42:53 2021 -0700 +++ b/service/mqtt_to_rdf/inference.py Wed Sep 08 18:51:18 2021 -0700 @@ -55,21 +55,21 @@ def __repr__(self): return f"Lhs({graphDump(self.graph)})" - def findCandidateBindings(self, workingSet: ReadOnlyWorkingSet, stats) -> Iterator['BoundLhs']: + def findCandidateBindings(self, knownTrue: ReadOnlyWorkingSet, stats) -> Iterator['BoundLhs']: """bindings that fit the LHS of a rule, using statements from workingSet and functions from LHS""" log.debug(f'{INDENT*3} nodesToBind: {self.lhsBindables}') stats['findCandidateBindingsCalls'] += 1 - if not self._allStaticStatementsMatch(workingSet): + if not self._allStaticStatementsMatch(knownTrue): stats['findCandidateBindingEarlyExits'] += 1 return - for binding in self._possibleBindings(workingSet, stats): + for binding in self._possibleBindings(knownTrue, stats): log.debug('') log.debug(f'{INDENT*4}*trying {binding.binding}') - if not binding.verify(workingSet): + if not binding.verify(knownTrue): log.debug(f'{INDENT*4} this binding did not verify') stats['permCountFailingVerify'] += 1 continue @@ -77,11 +77,11 @@ stats['permCountSucceeding'] += 1 yield binding - def _allStaticStatementsMatch(self, workingSet: ReadOnlyWorkingSet) -> bool: + def _allStaticStatementsMatch(self, knownTrue: ReadOnlyWorkingSet) -> bool: # bug: see TestSelfFulfillingRule.test3 for a case where this rule's # static stmt is matched by a non-static stmt in the rule itself for ruleStmt in self.staticRuleStmts: - if ruleStmt not in workingSet: + if ruleStmt not in knownTrue: log.debug(f'{INDENT*3} {ruleStmt} not in working set- skip rule') return False return True