diff --git a/.gitmodules b/.gitmodules index b399eb9b..1597771e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,11 +4,11 @@ [submodule "sc-web"] path = sc-web url = https://github.com/ostis-ai/sc-web - branch = release/0.8.0 + branch = 0.8.1-Unlock [submodule "problem-solver/sc-machine"] path = problem-solver/sc-machine url = https://github.com/ostis-ai/sc-machine - branch = release/0.8.0 + branch = 0.9.0-Unlock [submodule "kb/ims.ostis.kb"] path = kb/ims.ostis.kb url = https://github.com/ostis-ai/ims.ostis.kb diff --git a/problem-solver/cxx/commonModule/agent/NonAtomicActionInterpreterAgent.cpp b/problem-solver/cxx/commonModule/agent/NonAtomicActionInterpreterAgent.cpp index 8bcff17c..aad50a27 100644 --- a/problem-solver/cxx/commonModule/agent/NonAtomicActionInterpreterAgent.cpp +++ b/problem-solver/cxx/commonModule/agent/NonAtomicActionInterpreterAgent.cpp @@ -23,12 +23,12 @@ SC_AGENT_IMPLEMENTATION(NonAtomicActionInterpreterAgent) try { ScAddr nonAtomicActionTemplateAddr = - utils::IteratorUtils::getFirstByOutRelation(&m_memoryCtx, actionAddr, CoreKeynodes::rrel_1); + utils::IteratorUtils::getAnyByOutRelation(&m_memoryCtx, actionAddr, CoreKeynodes::rrel_1); if (!nonAtomicActionTemplateAddr.IsValid()) { throw std::runtime_error("Action params are not formed correctly."); } - ScAddr argumentsSet = utils::IteratorUtils::getFirstByOutRelation(&m_memoryCtx, actionAddr, CoreKeynodes::rrel_2); + ScAddr argumentsSet = utils::IteratorUtils::getAnyByOutRelation(&m_memoryCtx, actionAddr, CoreKeynodes::rrel_2); ScTemplateParams templateParams = createTemplateParams(nonAtomicActionTemplateAddr, argumentsSet); nonAtomicActionAddr = replaceNonAtomicAction(nonAtomicActionTemplateAddr, templateParams); @@ -81,7 +81,7 @@ void NonAtomicActionInterpreterAgent::generateNonAtomicActionTemplate( ScAddr NonAtomicActionInterpreterAgent::getTemplateKeyElement(ScAddr const & templateAddr) { ScAddr templateKeyElement = - utils::IteratorUtils::getFirstByOutRelation(&m_memoryCtx, templateAddr, CoreKeynodes::rrel_key_sc_element); + utils::IteratorUtils::getAnyByOutRelation(&m_memoryCtx, templateAddr, CoreKeynodes::rrel_key_sc_element); if (!templateKeyElement.IsValid()) { @@ -107,7 +107,7 @@ ScTemplateParams NonAtomicActionInterpreterAgent::createTemplateParams( { break; } - ScAddr argument = utils::IteratorUtils::getFirstByOutRelation(&m_memoryCtx, argumentsSet, role); + ScAddr argument = utils::IteratorUtils::getAnyByOutRelation(&m_memoryCtx, argumentsSet, role); if (!argument.IsValid()) { break; diff --git a/problem-solver/cxx/commonModule/handler/NumberHandler.cpp b/problem-solver/cxx/commonModule/handler/NumberHandler.cpp index bc3f436a..3f4c2b6c 100644 --- a/problem-solver/cxx/commonModule/handler/NumberHandler.cpp +++ b/problem-solver/cxx/commonModule/handler/NumberHandler.cpp @@ -28,7 +28,7 @@ ScAddr commonModule::NumberHandler::findNumberNode(const double & number) for (ScAddr candidateLink : candidateList) { - ScAddr candidateNode = utils::IteratorUtils::getFirstByInRelation( + ScAddr candidateNode = utils::IteratorUtils::getAnyByInRelation( this->context, candidateLink, scAgentsCommon::CoreKeynodes::nrel_idtf); if (this->context->HelperCheckEdge( scAgentsCommon::CoreKeynodes::number, candidateNode, ScType::EdgeAccessConstPosPerm)) @@ -45,7 +45,7 @@ ScAddr commonModule::NumberHandler::generateNumberNode(const double & number) std::string numberAsString = this->numberToLikView(number); ScAddr numberLink = this->linkHandler->createLink(numberAsString); ScTemplate scTemplate; - scTemplate.TripleWithRelation( + scTemplate.Quintuple( ScType::NodeVar >> "_number_node", ScType::EdgeDCommonVar, numberLink, diff --git a/problem-solver/cxx/commonModule/handler/ParameterHandler.cpp b/problem-solver/cxx/commonModule/handler/ParameterHandler.cpp index 396fac46..7674f28e 100644 --- a/problem-solver/cxx/commonModule/handler/ParameterHandler.cpp +++ b/problem-solver/cxx/commonModule/handler/ParameterHandler.cpp @@ -49,7 +49,7 @@ ScAddr ParameterHandler::findParameterNodeByNumber( ScAddr parameterNode = ScAddr(); ScTemplate scTemplate; scTemplate.Triple(parameterClass, ScType::EdgeAccessVarPosPerm, ScType::NodeVar >> "_parameter_node"); - scTemplate.TripleWithRelation( + scTemplate.Quintuple( "_parameter_node", ScType::EdgeDCommonVar, numberNode, ScType::EdgeAccessVarPosPerm, measurementRel); ScAddrVector parameterNodes = ScTemplateUtils::getAllWithKey(this->context, scTemplate, "_parameter_node"); if (parameterNodes.size() == 1) @@ -102,7 +102,7 @@ ScAddr ParameterHandler::generateParameterNode( { ScTemplate scTemplate; scTemplate.Triple(parameterClass, ScType::EdgeAccessVarPosPerm, ScType::NodeVar >> "_parameter_node"); - scTemplate.TripleWithRelation( + scTemplate.Quintuple( "_parameter_node", ScType::EdgeDCommonVar, numberNode, ScType::EdgeAccessVarPosPerm, measurementRel); ScTemplateGenResult genResult; diff --git a/problem-solver/cxx/commonModule/interpreter/NonAtomicActionInterpreter.cpp b/problem-solver/cxx/commonModule/interpreter/NonAtomicActionInterpreter.cpp index 3ca4ce50..e7e4ce8d 100644 --- a/problem-solver/cxx/commonModule/interpreter/NonAtomicActionInterpreter.cpp +++ b/problem-solver/cxx/commonModule/interpreter/NonAtomicActionInterpreter.cpp @@ -18,7 +18,7 @@ NonAtomicActionInterpreter::NonAtomicActionInterpreter(ScMemoryContext * ms_cont void NonAtomicActionInterpreter::interpret(ScAddr const & nonAtomicActionAddr) { ScAddr decompositionTuple = - utils::IteratorUtils::getFirstByInRelation(context, nonAtomicActionAddr, Keynodes::nrel_decomposition_of_action); + utils::IteratorUtils::getAnyByInRelation(context, nonAtomicActionAddr, Keynodes::nrel_decomposition_of_action); ScAddr action = getFirstSubAction(decompositionTuple); while (action.IsValid()) { @@ -34,7 +34,7 @@ void NonAtomicActionInterpreter::interpret(ScAddr const & nonAtomicActionAddr) ScAddr NonAtomicActionInterpreter::getFirstSubAction(ScAddr const & decompositionTuple) { ScAddr firstAction = - utils::IteratorUtils::getFirstByOutRelation(context, decompositionTuple, scAgentsCommon::CoreKeynodes::rrel_1); + utils::IteratorUtils::getAnyByOutRelation(context, decompositionTuple, scAgentsCommon::CoreKeynodes::rrel_1); if (!firstAction.IsValid()) { throw std::runtime_error("Non atomic action structure is incorrect. Failed to find first action."); @@ -79,7 +79,7 @@ ScAddr NonAtomicActionInterpreter::getNextAction(ScAddr const & actionAddr) ScAddr NonAtomicActionInterpreter::getThenAction(ScAddr const & actionAddr) { - ScAddr nextAction = utils::IteratorUtils::getFirstByOutRelation(context, actionAddr, Keynodes::nrel_then); + ScAddr nextAction = utils::IteratorUtils::getAnyByOutRelation(context, actionAddr, Keynodes::nrel_then); if (!nextAction.IsValid()) { SC_LOG_DEBUG("Action with nrel_then relation not found, searching for nrel_goto instead"); @@ -90,7 +90,7 @@ ScAddr NonAtomicActionInterpreter::getThenAction(ScAddr const & actionAddr) ScAddr NonAtomicActionInterpreter::getElseAction(ScAddr const & actionAddr) { - ScAddr nextAction = utils::IteratorUtils::getFirstByOutRelation(context, actionAddr, Keynodes::nrel_else); + ScAddr nextAction = utils::IteratorUtils::getAnyByOutRelation(context, actionAddr, Keynodes::nrel_else); if (!nextAction.IsValid()) { SC_LOG_DEBUG("Action with nrel_else relation not found, searching for nrel_goto instead"); @@ -101,5 +101,5 @@ ScAddr NonAtomicActionInterpreter::getElseAction(ScAddr const & actionAddr) ScAddr NonAtomicActionInterpreter::getGoToAction(ScAddr const & actionAddr) { - return utils::IteratorUtils::getFirstByOutRelation(context, actionAddr, Keynodes::nrel_goto); + return utils::IteratorUtils::getAnyByOutRelation(context, actionAddr, Keynodes::nrel_goto); } diff --git a/problem-solver/sc-machine b/problem-solver/sc-machine index a1863f3d..70cc34e1 160000 --- a/problem-solver/sc-machine +++ b/problem-solver/sc-machine @@ -1 +1 @@ -Subproject commit a1863f3d469e52cdf51a465fdcf6d364564fe5a6 +Subproject commit 70cc34e1cefdfb168db12e9c87b94bd9a3550bfe diff --git a/sc-web b/sc-web index ebccdbce..8ee7340f 160000 --- a/sc-web +++ b/sc-web @@ -1 +1 @@ -Subproject commit ebccdbce8283365a7cfa8930e0aa6c24077cb418 +Subproject commit 8ee7340f86e017d4af770d8a43ba28d144d663a6 diff --git a/subsystems/scl-machine b/subsystems/scl-machine index ef24d083..14136fdb 160000 --- a/subsystems/scl-machine +++ b/subsystems/scl-machine @@ -1 +1 @@ -Subproject commit ef24d0833077f5f4623528b6b87d7dad4131c2af +Subproject commit 14136fdb6ffcfa8c91f2f3ac79157f13ac2fe0b1