Fixed #29: Parsers: Implement parsing memoization
Fixed #77 : Parser: ShortTermMemoryParser should be called separately Fixed #78 : Remove VariableNode usage Fixed #79 : ConceptManager: Implement compile caching Fixed #80 : SheerkaExecute : parsers_key is not correctly computed Fixed #81 : ValidateConceptEvaluator : Validate concept's where and pre clauses right after the parsing Fixed #82 : SheerkaIsAManager: isa() failed when the set as a body Fixed #83 : ValidateConceptEvaluator : Support BNF and SYA Concepts Fixed #84 : ExpressionParser: Implement the parser as a standard parser Fixed #85 : Services: Give order to services Fixed #86 : cannot manage smart_get_attr(the short, color)
This commit is contained in:
@@ -116,6 +116,7 @@ class Sheerka(Concept):
|
||||
"test_dict": SheerkaMethod(self.test_dict, False),
|
||||
"test_error": SheerkaMethod(self.test_error, False),
|
||||
"is_sheerka": SheerkaMethod(self.is_sheerka, False),
|
||||
"objvalue": SheerkaMethod(self.objvalue, False),
|
||||
}
|
||||
|
||||
self.concepts_ids = None
|
||||
@@ -409,7 +410,7 @@ class Sheerka(Concept):
|
||||
"""
|
||||
|
||||
def add_recognized_by(c, _recognized_by):
|
||||
c.set_hint(BuiltinConcepts.RECOGNIZED_BY, _recognized_by)
|
||||
c.get_hints().recognized_by = _recognized_by
|
||||
return c
|
||||
|
||||
def new_instances(concepts, _recognized_by):
|
||||
@@ -444,8 +445,8 @@ class Sheerka(Concept):
|
||||
if concept[1]:
|
||||
if self.is_known(found := self.get_by_id(concept[1])):
|
||||
instance = self.new_from_template(found, found.key)
|
||||
instance._metadata.is_evaluated = True
|
||||
instance.set_hint(BuiltinConcepts.RECOGNIZED_BY, RECOGNIZED_BY_ID)
|
||||
instance.get_hints().is_evaluated = True
|
||||
instance.get_hints().recognized_by = RECOGNIZED_BY_ID
|
||||
return instance
|
||||
elif concept[0]:
|
||||
if self.is_known(found := self.get_by_name(concept[0])):
|
||||
@@ -466,7 +467,7 @@ class Sheerka(Concept):
|
||||
|
||||
def fast_resolve(self, key, return_new=True):
|
||||
def add_recognized_by(c, _recognized_by):
|
||||
c.set_hint(BuiltinConcepts.RECOGNIZED_BY, _recognized_by)
|
||||
c.get_hints().recognized_by = _recognized_by
|
||||
return c
|
||||
|
||||
def new_instances(concepts, _recognized_by):
|
||||
@@ -557,7 +558,7 @@ class Sheerka(Concept):
|
||||
return self.new(BuiltinConcepts.UNKNOWN_PROPERTY, body=k, concept=concept)
|
||||
|
||||
# TODO : add the concept to the list of known concepts (self.instances)
|
||||
concept._metadata.is_evaluated = True # because we have manually set the variables
|
||||
concept.get_hints().is_evaluated = True # because we have manually set the variables
|
||||
return concept
|
||||
|
||||
def push_ontology(self, context, name, cache_only=False):
|
||||
@@ -720,6 +721,9 @@ class Sheerka(Concept):
|
||||
else:
|
||||
return [_obj]
|
||||
|
||||
if self.isinstance(_obj, BuiltinConcepts.FILTERED):
|
||||
return inner_get_errors(_obj.reason)
|
||||
|
||||
if isinstance(_obj, Concept) and _obj.body != NotInit:
|
||||
return inner_get_errors(_obj.body)
|
||||
|
||||
@@ -831,7 +835,7 @@ class Sheerka(Concept):
|
||||
|
||||
unknown_concept = UnknownConcept() # don't use new() for prevent circular reference
|
||||
unknown_concept.set_value(ConceptParts.BODY, metadata)
|
||||
unknown_concept._metadata.is_evaluated = True
|
||||
unknown_concept.get_hints().is_evaluated = True
|
||||
return unknown_concept
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user