Skip to content

Commit

Permalink
build: update sc-machine, sc-web and scl-machine
Browse files Browse the repository at this point in the history
  • Loading branch information
KovalM committed Apr 15, 2024
1 parent fee0b4c commit 4d0acda
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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())
{
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions problem-solver/cxx/commonModule/handler/NumberHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions problem-solver/cxx/commonModule/handler/ParameterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -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.");
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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);
}
2 changes: 1 addition & 1 deletion problem-solver/sc-machine
Submodule sc-machine updated 656 files
2 changes: 1 addition & 1 deletion sc-web
Submodule sc-web updated 40 files
+1 −0 Gruntfile.js
+1 −0 client/js/Core/componentmanger.js
+23 −388 client/js/Core/componentsandbox.js
+3 −13 client/js/Core/main.js
+544 −0 client/js/Core/scg-content-searcher.js
+9 −8 client/js/Ui/core.js
+3 −0 client/js/Ui/expertmodepanel.js
+2 −0 client/js/Ui/windowmanager.js
+1 −0 client/js/Utils/sc_keynodes.js
+2 −2 client/static/common/d3/d3.js
+4 −4 client/static/components/js/image/image.js
+1 −1 client/static/components/js/map/googlemaplink.js
+2 −2 client/static/components/js/pdf/pdf.js
+1 −1 client/static/components/js/youtube/youtubelink.js
+1 −1 components/html/src/html-component.js
+5 −6 components/scg/src/command/delete-objects.js
+4 −2 components/scg/src/command/get-node-from-memory.js
+1 −1 components/scg/src/gwf-file-creater.js
+2 −2 components/scg/src/gwf-object-info-reader.js
+26 −15 components/scg/src/scg-alphabet.js
+13 −3 components/scg/src/scg-layout.js
+16 −22 components/scg/src/scg-model-objects.js
+7 −12 components/scg/src/scg-render.js
+11 −12 components/scg/src/scg-scene.js
+81 −36 components/scg/src/scg-struct.js
+3 −1 components/scg/src/scg.js
+5 −24 components/scg/static/components/css/scg.css
+ components/scg/static/components/images/scg/alphabet/scg-arc-common.png
+ components/scg/static/components/images/scg/alphabet/scg-arc-var.png
+ components/scg/static/components/images/scg/alphabet/scg-edge-common.png
+ components/scg/static/components/images/scg/alphabet/scg-edge-var.png
+29 −1 docs/changelog.md
+2 −2 package-lock.json
+1 −1 package.json
+1 −1 requirements.txt
+0 −10 scripts/install.sh
+0 −14 scripts/run_scweb.sh
+1 −0 server/app.py
+9 −9 server/handlers/api_logic.py
+14 −4 server/handlers/base.py
2 changes: 1 addition & 1 deletion subsystems/scl-machine
Submodule scl-machine updated 50 files
+1 −1 README.md
+7 −1 docs/changelog.md
+203 −0 docs/images/replacements_example.gwf
+ docs/images/replacements_example.png
+ docs/main.pdf
+1 −1 docs/main.tex
+45 −5 docs/scl-machine.tex
+18 −20 problem-solver/cxx/inferenceModule/agent/DirectInferenceAgent.cpp
+1 −1 problem-solver/cxx/inferenceModule/agent/DirectInferenceAgent.hpp
+19 −0 problem-solver/cxx/inferenceModule/factory/InferenceManagerFactory.cpp
+9 −9 problem-solver/cxx/inferenceModule/generator/SolutionTreeGenerator.cpp
+4 −2 problem-solver/cxx/inferenceModule/generator/SolutionTreeGenerator.hpp
+16 −1 problem-solver/cxx/inferenceModule/inferenceConfig/InferenceConfig.hpp
+5 −1 problem-solver/cxx/inferenceModule/logic/LogicExpressionNode.hpp
+204 −59 problem-solver/cxx/inferenceModule/logic/TemplateExpressionNode.cpp
+34 −0 problem-solver/cxx/inferenceModule/logic/TemplateExpressionNode.hpp
+4 −4 problem-solver/cxx/inferenceModule/manager/inferenceManager/DirectInferenceManagerTarget.cpp
+3 −11 problem-solver/cxx/inferenceModule/manager/inferenceManager/InferenceManagerAbstract.cpp
+5 −3 problem-solver/cxx/inferenceModule/manager/solutionTreeManager/SolutionTreeManager.cpp
+2 −2 problem-solver/cxx/inferenceModule/manager/solutionTreeManager/SolutionTreeManagerAbstract.cpp
+2 −2 problem-solver/cxx/inferenceModule/manager/solutionTreeManager/SolutionTreeManagerAbstract.hpp
+14 −15 problem-solver/cxx/inferenceModule/manager/templateManager/TemplateManager.cpp
+15 −3 problem-solver/cxx/inferenceModule/manager/templateManager/TemplateManagerAbstract.hpp
+2 −2 problem-solver/cxx/inferenceModule/manager/templateManager/TemplateManagerFixedArguments.cpp
+24 −24 problem-solver/cxx/inferenceModule/searcher/solutionTreeSearcher/SolutionTreeSearcher.cpp
+2 −1 problem-solver/cxx/inferenceModule/searcher/solutionTreeSearcher/SolutionTreeSearcher.hpp
+27 −25 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherAbstract.cpp
+51 −8 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherAbstract.hpp
+18 −18 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherGeneral.cpp
+2 −2 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherGeneral.hpp
+62 −44 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherInStructures.cpp
+9 −1 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherInStructures.hpp
+63 −0 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherOnlyAccessEdgesInStructures.cpp
+31 −0 problem-solver/cxx/inferenceModule/searcher/templateSearcher/TemplateSearcherOnlyAccessEdgesInStructures.hpp
+7 −1 problem-solver/cxx/inferenceModule/test/testStructures/DirectInferenceManagerAll/generateUniqueTest.scs
+49 −0 ...lem-solver/cxx/inferenceModule/test/testStructures/DirectInferenceManagerAll/singleApplyAccessEdgesTest.scs
+1 −1 problem-solver/cxx/inferenceModule/test/testStructures/DirectInferenceManagerAll/singleApplyTest.scs
+23 −0 ...-solver/cxx/inferenceModule/test/testStructures/TemplateSearchModule/searchStructuresWithoutAccessEdges.scs
+4 −0 ...cxx/inferenceModule/test/testStructures/TemplateSearchModule/searchWithContentSingleResultTestStructure.scs
+15 −0 ...er/cxx/inferenceModule/test/testStructures/TemplateSearchModule/searchWithExistedConstructionsStructure.scs
+52 −0 problem-solver/cxx/inferenceModule/test/units/ConfigGenerators.hpp
+8 −20 problem-solver/cxx/inferenceModule/test/units/TestComplexFormulas.cpp
+41 −23 problem-solver/cxx/inferenceModule/test/units/TestDirectInferenceManager.cpp
+359 −29 problem-solver/cxx/inferenceModule/test/units/TestDirectInferenceManagerAll.cpp
+5 −15 problem-solver/cxx/inferenceModule/test/units/TestLogicModuleArguments.cpp
+14 −35 problem-solver/cxx/inferenceModule/test/units/TestSimpleFormulas.cpp
+162 −44 problem-solver/cxx/inferenceModule/test/units/TestTemplateSearchModule.cpp
+278 −51 problem-solver/cxx/inferenceModule/utils/ReplacementsUtils.cpp
+10 −5 problem-solver/cxx/inferenceModule/utils/ReplacementsUtils.hpp
+12 −0 problem-solver/cxx/inferenceModule/utils/Types.hpp

0 comments on commit 4d0acda

Please sign in to comment.