Fixed #68: Implement SheerkaQL

Fixed #70: SheerkaFilterManager : Pipe functions
Fixed #71: SheerkaFilterManager : filter_objects
Fixed #75: SheerkaMemory: Enhance memory() to use the filtering capabilities
Fixed #76: SheerkaEvaluateConcept: Concepts that modify the state of the system must not be evaluated during question
This commit is contained in:
2021-04-26 19:13:47 +02:00
parent bef5f3208c
commit 1059ce25c5
57 changed files with 5759 additions and 1302 deletions
+16 -1
View File
@@ -3,7 +3,7 @@ import time
from os import path
from core.builtin_concepts_ids import BuiltinConcepts, BuiltinContainers
from core.builtin_helpers import ensure_concept_or_rule
from core.builtin_helpers import ensure_concept_or_rule, ensure_concept
from core.concept import Concept
from core.global_symbols import SHEERKA_BACKUP_FOLDER
from core.sheerka.services.SheerkaHistoryManager import SheerkaHistoryManager
@@ -37,6 +37,7 @@ class SheerkaAdmin(BaseService):
self.sheerka.bind_service_method(self.admin_history, False, as_name="history")
self.sheerka.bind_service_method(self.admin_history, False, as_name="history")
self.sheerka.bind_service_method(self.sdp, False)
self.sheerka.bind_service_method(self.atomic_def, False)
def caches_names(self):
"""
@@ -218,6 +219,20 @@ class SheerkaAdmin(BaseService):
return self.sheerka.isinstance(a, b)
@staticmethod
def atomic_def(a):
"""
Return the 'atomic definition' of a concept
a concept key stripped from its 'var' tokens
>>> assert atomic_def(Concept('a plus b').def_var("a").def_var("b")) == "plus"
>>> assert atomic_def(Concept('x is a y').def_var("x").def_var("y")) == "is a"
:param a:
:return:
"""
ensure_concept(a)
return a.get_atomic_def()
@staticmethod
def is_container(obj):
"""