Implemented a first and basic version of a Rete rule engine

This commit is contained in:
2021-02-09 16:06:32 +01:00
parent 821dbed189
commit a2a8d5c5e5
110 changed files with 7301 additions and 1654 deletions
+3 -3
View File
@@ -14,17 +14,17 @@ class TestRuleParser(TestUsingMemoryBasedSheerka):
@classmethod
def setup_class(cls):
init_test_helper = cls().init_test(cache_only=False, ontology="#TestRuleParser#")
sheerka, context, *updated = init_test_helper.with_rules(*my_rules).unpack()
sheerka, context, *updated = init_test_helper.with_format_rules(*my_rules).unpack()
cls.shared_ontology = sheerka.get_ontology(context)
sheerka.pop_ontology()
sheerka.pop_ontology(context)
def init_parser(self, rules=None, **kwargs):
if rules is None:
sheerka, context = self.init_test().unpack()
sheerka.add_ontology(context, self.shared_ontology)
else:
sheerka, context, *updated = self.init_test().with_rules(*rules, **kwargs).unpack()
sheerka, context, *updated = self.init_test().with_format_rules(*rules, **kwargs).unpack()
parser = RuleParser()
return sheerka, context, parser