Implemented SheerkaOntology

This commit is contained in:
2021-01-11 15:36:03 +01:00
parent e3c2adb533
commit e26c83a825
119 changed files with 6876 additions and 2002 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
from core.builtin_concepts import BuiltinConcepts
from core.concept import Concept, NotInit
from core.concept import Concept
from core.global_symbols import NotInit
from evaluators.BaseEvaluator import OneReturnValueEvaluator
@@ -8,6 +9,7 @@ class PostExecutionEvaluator(OneReturnValueEvaluator):
Last chance to alter the return_value
This evaluator is supposed to be a generic evaluator for all rules that must be executed just before
the aggregations
As of now, the AUTO_EVAL rule implementation is simply hardcoded
"""
NAME = "PostExecution"
@@ -20,12 +22,11 @@ class PostExecutionEvaluator(OneReturnValueEvaluator):
if len(evaluation_parents) > 1:
return False # It must be executed only when the top level context
# only support the rule for the COMMANDS
value = return_value.body
return isinstance(value, Concept) and context.sheerka.isa(value, context.sheerka.new(BuiltinConcepts.AUTO_EVAL))
def eval(self, context, return_value):
# only support the rule for the COMMANDS ??
# only support the rule for the AUTO_EVAL
return context.sheerka.ret(
self.name,
True,