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
@@ -51,7 +51,7 @@ class TestAddConceptInSetEvaluator(TestUsingMemoryBasedSheerka):
assert res.value.body == "bar"
def test_i_can_add_concept_to_a_set_of_concept(self):
sheerka, context, foo, bar = self.init_concepts("foo", "bar", create_new=True)
sheerka, context, foo, bar = self.init_test().with_concepts("foo", "bar", create_new=True).unpack()
ret_val = get_isa_ret_val("foo", "bar")
res = AddConceptInSetEvaluator().eval(context, ret_val)
@@ -72,12 +72,12 @@ class TestAddConceptInSetEvaluator(TestUsingMemoryBasedSheerka):
So 'foo' cannot be put is set
:return:
"""
sheerka, context, one, two, foo, bar = self.init_concepts(
sheerka, context, one, two, foo, bar = self.init_test().with_concepts(
"one",
"two",
Concept("foo", definition="(one|two)=a 'plus' (one|two)=b", body="a + b").def_var("a").def_var("b"),
"bar",
create_new=True)
create_new=True).unpack()
ret_val = get_isa_ret_val("foo", "bar")
res = AddConceptInSetEvaluator().eval(context, ret_val)
@@ -107,7 +107,7 @@ class TestAddConceptInSetEvaluator(TestUsingMemoryBasedSheerka):
assert context.sheerka.isinstance(res.value, BuiltinConcepts.SUCCESS)
def test_i_cannot_add_the_same_concept_twice(self):
sheerka, context, foo, bar = self.init_concepts("foo", "bar", create_new=True)
sheerka, context, foo, bar = self.init_test().with_concepts("foo", "bar", create_new=True).unpack()
ret_val = get_isa_ret_val("foo", "bar")
AddConceptInSetEvaluator().eval(context, ret_val)